mirror of
https://github.com/PaddlePaddle/PaddleClas.git
synced 2025-06-03 21:55:06 +08:00
fix vehicle attr doc (#2096)
This commit is contained in:
parent
1fe19cb701
commit
46ec76eb06
@ -178,7 +178,7 @@ from xml.dom.minidom import parse
|
|||||||
|
|
||||||
vehicleids = []
|
vehicleids = []
|
||||||
|
|
||||||
def convert_annotation(input_fp, output_fp):
|
def convert_annotation(input_fp, output_fp, subdir):
|
||||||
in_file = open(input_fp)
|
in_file = open(input_fp)
|
||||||
list_file = open(output_fp, 'w')
|
list_file = open(output_fp, 'w')
|
||||||
tree = parse(in_file)
|
tree = parse(in_file)
|
||||||
@ -201,12 +201,12 @@ def convert_annotation(input_fp, output_fp):
|
|||||||
typeid = int (item.getAttribute("typeID"))
|
typeid = int (item.getAttribute("typeID"))
|
||||||
label[typeid+9] = '1'
|
label[typeid+9] = '1'
|
||||||
label = ','.join(label)
|
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()
|
list_file.close()
|
||||||
|
|
||||||
convert_annotation('train_label.xml', 'train_list.txt') #imagename vehiclenum colorid typeid
|
convert_annotation('train_label.xml', 'train_list.txt', 'image_train') #imagename vehiclenum colorid typeid
|
||||||
convert_annotation('test_label.xml', 'test_list.txt')
|
convert_annotation('test_label.xml', 'test_list.txt', 'image_test')
|
||||||
```
|
```
|
||||||
|
|
||||||
执行上述命令后,`VeRi`目录中具有以下数据:
|
执行上述命令后,`VeRi`目录中具有以下数据:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user