Created
December 8, 2018 13:19
-
-
Save Mycenae/8b476e066335416a3eb212bdc8018ce8 to your computer and use it in GitHub Desktop.
Create corresponding trainval.txt for existing dataset image files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
path = os.getcwd() | |
dataAnnotated = os.listdir(path + '/JPEGImages') | |
dataNum = len(dataAnnotated) | |
ftrainval = open('trainval.txt', 'w') | |
info = '' | |
for name in dataAnnotated: | |
info += str(name).strip(".jpg") | |
info += '\n' | |
ftrainval.write(str(info)) | |
ftrainval.close() | |
print('done!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment