未验证 提交 46ec76eb 编写于 作者: littletomatodonkey's avatar littletomatodonkey 提交者: GitHub

fix vehicle attr doc (#2096)

上级 1fe19cb7
......@@ -178,7 +178,7 @@ from xml.dom.minidom import parse
vehicleids = []
def convert_annotation(input_fp, output_fp):
def convert_annotation(input_fp, output_fp, subdir):
in_file = open(input_fp)
list_file = open(output_fp, 'w')
tree = parse(in_file)
......@@ -201,12 +201,12 @@ def convert_annotation(input_fp, output_fp):
typeid = int (item.getAttribute("typeID"))
label[typeid+9] = '1'
label = ','.join(label)
list_file.write(os.path.join('image_train', name) + "\t" + label + "\n")
list_file.write(os.path.join(subdir, name) + "\t" + label + "\n")
list_file.close()
convert_annotation('train_label.xml', 'train_list.txt') #imagename vehiclenum colorid typeid
convert_annotation('test_label.xml', 'test_list.txt')
convert_annotation('train_label.xml', 'train_list.txt', 'image_train') #imagename vehiclenum colorid typeid
convert_annotation('test_label.xml', 'test_list.txt', 'image_test')
```
执行上述命令后,`VeRi`目录中具有以下数据:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册