##按行排列,图像路径
import os
import argparse
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('--path', type=str, default='./dataset/image', help='path to the dataset')
parser.add_argument('--output', type=str, default='./dataset/image', help='path to the file list')
args = parser.parse_args()
ext = {'.JPG', '.JPEG', '.PNG', '.TIF', 'TIFF'}
images = []
for root, dirs, files in os.walk(args.path):
print('loading ' + root)
for file in files:
if os.path.splitext(file)[1].upper() in ext:
images.append(os.path.join(root, file))
images = sorted(images)
np.savetxt(args.output, images, fmt='%s')
##摘自edge-connection
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)