File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66
77def loop_images ():
8+ root = os .getcwd ()
89 for x in range (10 ):
9- os .chdir (os . getcwd () + "/train_images_sorted/" + str (x ))
10+ os .chdir (root + "/train_images_sorted/" + str (x ))
1011 i = 0
1112 total = []
1213 for filename in os .listdir (os .getcwd ()):
Original file line number Diff line number Diff line change @@ -17,9 +17,7 @@ def read():
1717 percent = 1
1818 for line in f :
1919 i += 1
20- string_1 = str (os .getcwd ()) + "/train_images/" + file_name (i )
21- string_2 = str (os .getcwd ()) + "/train_images_sorted/" + str (line ) + "/" + file_name (i )
22- os .rename (string_1 ,string_2 )
20+ os .rename (str (os .getcwd ()) + "/train_images/" + file_name (i ), str (os .getcwd ()) + "/train_images_sorted/" + str (line ) + "/" + file_name (i ))
2321 if i % 600 == 0 :
2422 print (str (percent ) + "%" )
2523 percent += 1
You can’t perform that action at this time.
0 commit comments