同上,记录一些数据集处理的代码段
import os data_path = 'train_data/ground_truth' i = 1 for root, dirs, files in os.walk(data_path): for file in files: old_name = os.path.join(root, file) new_name = os.path.join(root, "IMG_{}".format(i) + ".mat") os.rename(old_name, new_name) i = i+1
顺便贴下os.walk方法:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)