Skip to content

Commit

Permalink
Update processing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
z1069614715 authored Dec 8, 2022
1 parent 2b76aa8 commit f60dc7f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def parse_opt():

if __name__ == '__main__':
opt = parse_opt()
# with open(opt.label_path, 'w+', encoding='utf-8') as f:
# f.write('\n'.join(os.listdir(opt.data_path)))
with open(opt.label_path, 'w+', encoding='utf-8') as f:
f.write('\n'.join(os.listdir(opt.data_path)))

str_len = len(str(len(os.listdir(opt.data_path))))

# for idx, i in enumerate(os.listdir(opt.data_path)):
# os.rename(r'{}/{}'.format(opt.data_path, i), r'{}/{}'.format(opt.data_path, str(idx).zfill(str_len)))
for idx, i in enumerate(os.listdir(opt.data_path)):
os.rename(r'{}/{}'.format(opt.data_path, i), r'{}/{}'.format(opt.data_path, str(idx).zfill(str_len)))

os.chdir(opt.data_path)

Expand Down

0 comments on commit f60dc7f

Please sign in to comment.