-
-
Save tsycnh/177bbf7d93adc6207242fd334ce3bb60 to your computer and use it in GitHub Desktop.
给17类的牛津花朵数据集,增加label
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
file_a = open('/Users/shidanlifuhetian/All/data/flowers17/files.txt',mode='r') | |
text = file_a.readlines() | |
file_a.close() | |
file_b = open('./newtesx.txt',mode='a') | |
for i,item in enumerate(text): | |
if i%80 ==0: | |
class_num = str(i//80) | |
t = item.split('\n') | |
newtext = t[0]+' '+class_num+'\n' | |
print(newtext) | |
file_b.write(newtext) | |
file_b.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment