21 lines
805 B
Python
Executable File
21 lines
805 B
Python
Executable File
import os
|
|
in_path = "/data/DataManagement/Project/001_cuihu/CAS_CuihuBird/CDB_Cuihubird/ImageSets/Main/test.txt"
|
|
out_path = "/data/DataManagement/Project/001_cuihu/CAS_CuihuBird/CDB_Cuihubird/ImageSets/Main/test1.txt"
|
|
def change(in_path,out_path):
|
|
new = []
|
|
f = open(in_path,'r')
|
|
lines = f.readlines()
|
|
for line in lines:
|
|
line = line.strip('\n')
|
|
line = "./images/{}.jpg".format(line)+" "+"./Annotations/{}.xml".format(line)+"\n"
|
|
new.append(line)
|
|
# while(line):
|
|
# line = f.readline().replace("\n","")
|
|
# line = "./images/{}".format(line) + " " + "./Annotations/{}".format(line) +"\n"
|
|
# print(line)
|
|
# new.append(line)
|
|
handle = open(out_path, 'a')
|
|
handle.writelines(new)
|
|
|
|
if __name__ == '__main__':
|
|
change(in_path,out_path) |