13 lines
351 B
Python
13 lines
351 B
Python
# -*- coding: utf-8 -*-
|
||
|
||
import os
|
||
import random
|
||
|
||
#将./testimages 里图片处理成test.txt,用于检测。存放在./dataPath/test.txt
|
||
paths = r'./testimages' # 储存图片的文件夹路径
|
||
f = open('./dataPath/test.txt', 'w')
|
||
filenames = os.listdir(paths) # 读取图片名称
|
||
for filename in filenames:
|
||
out = filename.split('.jpg')[0]
|
||
f.write(out + '\n')
|
||
f.close() |