Skip to content

Commit 4af2593

Browse files
coderzbxzhangbenxing
authored andcommitted
增加cityscapes数据集的处理脚本
1 parent fc002f8 commit 4af2593

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

SelfScripts/file_list.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import os
2+
import argparse
3+
4+
if __name__ == '__main__':
5+
parser = argparse.ArgumentParser()
6+
parser.add_argument('--image_dir', type=str, required=False)
7+
parser.add_argument('--text_dir', type=str, required=False)
8+
args = parser.parse_args()
9+
10+
image_dir = args.image_dir
11+
txt_dir = args.text_dir
12+
13+
image_list = os.listdir(image_dir)
14+
with open(txt_dir, "wb") as f:
15+
for id in image_list:
16+
name_list = id.split(".")
17+
name_ext = name_list[len(name_list) - 1]
18+
if name_ext != 'png' and name_ext != 'jpg':
19+
continue
20+
21+
str = id + '\t' + id + '\n'
22+
f.write(str)

0 commit comments

Comments
 (0)