-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathcar_models.py
134 lines (116 loc) · 7.97 KB
/
car_models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/usr/bin/env python
"""
Brief: The Car model summary by ApolloCar3D dataset paper
"""
from collections import namedtuple
#--------------------------------------------------------------------------------
# Definitions
#--------------------------------------------------------------------------------
# a label and all meta information
Label = namedtuple('Label', [
'name' , # The name of a car type
'id' , # id for specific car type
'category' , # The name of the car category, 'SUV', 'Sedan' etc
'categoryId' , # The ID of car category. Used to create ground truth images
# on category level.
])
#--------------------------------------------------------------------------------
# A list of all labels
#--------------------------------------------------------------------------------
# Please adapt the train IDs as appropriate for you approach.
# Note that you might want to ignore labels with ID 255 during training.
# Further note that the current train IDs are only a suggestion. You can use whatever you like.
# Make sure to provide your results using the original IDs and not the training IDs.
# Note that many IDs are ignored in evaluation and thus you never need to predict these!
models = [
# name id is_valid category categoryId
Label( 'baojun-310-2017', 0, '2x', 0),
Label( 'biaozhi-3008', 1, '2x', 0),
Label( 'biaozhi-liangxiang', 2, '2x', 0),
Label( 'bieke-yinglang-XT', 3, '2x', 0),
Label( 'biyadi-2x-F0', 4, '2x', 0),
Label( 'changanbenben', 5, '2x', 0),
Label( 'dongfeng-DS5', 6, '2x', 0),
Label( 'feiyate', 7, '2x', 0),
Label( 'fengtian-liangxiang', 8, '2x', 0),
Label( 'fengtian-MPV', 9, '2x', 0),
Label( 'jilixiongmao-2015', 10, '2x', 0),
Label( 'lingmu-aotuo-2009', 11, '2x', 0),
Label( 'lingmu-swift', 12, '2x', 0),
Label( 'lingmu-SX4-2012', 13, '2x', 0),
Label( 'sikeda-jingrui', 14, '2x', 0),
Label( 'fengtian-weichi-2006', 15, '3x', 1),
Label( '037-CAR02', 16, '3x', 1),
Label( 'aodi-a6', 17, '3x', 1),
Label( 'baoma-330', 18, '3x', 1),
Label( 'baoma-530', 19, '3x', 1),
Label( 'baoshijie-paoche', 20, '3x', 1),
Label( 'bentian-fengfan', 21, '3x', 1),
Label( 'biaozhi-408', 22, '3x', 1),
Label( 'biaozhi-508', 23, '3x', 1),
Label( 'bieke-kaiyue', 24, '3x', 1),
Label( 'fute', 25, '3x', 1),
Label( 'haima-3', 26, '3x', 1),
Label( 'kaidilake-CTS', 27, '3x', 1),
Label( 'leikesasi', 28, '3x', 1),
Label( 'mazida-6-2015', 29, '3x', 1),
Label( 'MG-GT-2015', 30, '3x', 1),
Label( 'oubao', 31, '3x', 1),
Label( 'qiya', 32, '3x', 1),
Label( 'rongwei-750', 33, '3x', 1),
Label( 'supai-2016', 34, '3x', 1),
Label( 'xiandai-suonata', 35, '3x', 1),
Label( 'yiqi-benteng-b50', 36, '3x', 1),
Label( 'bieke', 37, '3x', 1),
Label( 'biyadi-F3', 38, '3x', 1),
Label( 'biyadi-qin', 39, '3x', 1),
Label( 'dazhong', 40, '3x', 1),
Label( 'dazhongmaiteng', 41, '3x', 1),
Label( 'dihao-EV', 42, '3x', 1),
Label( 'dongfeng-xuetielong-C6', 43, '3x', 1),
Label( 'dongnan-V3-lingyue-2011', 44, '3x', 1),
Label( 'dongfeng-yulong-naruijie', 45, 'SUV', 2),
Label( '019-SUV', 46, 'SUV', 2),
Label( '036-CAR01', 47, 'SUV', 2),
Label( 'aodi-Q7-SUV', 48, 'SUV', 2),
Label( 'baojun-510', 49, 'SUV', 2),
Label( 'baoma-X5', 50, 'SUV', 2),
Label( 'baoshijie-kayan', 51, 'SUV', 2),
Label( 'beiqi-huansu-H3', 52, 'SUV', 2),
Label( 'benchi-GLK-300', 53, 'SUV', 2),
Label( 'benchi-ML500', 54, 'SUV', 2),
Label( 'fengtian-puladuo-06', 55, 'SUV', 2),
Label( 'fengtian-SUV-gai', 56, 'SUV', 2),
Label( 'guangqi-chuanqi-GS4-2015', 57, 'SUV', 2),
Label( 'jianghuai-ruifeng-S3', 58, 'SUV', 2),
Label( 'jili-boyue', 59, 'SUV', 2),
Label( 'jipu-3', 60, 'SUV', 2),
Label( 'linken-SUV', 61, 'SUV', 2),
Label( 'lufeng-X8', 62, 'SUV', 2),
Label( 'qirui-ruihu', 63, 'SUV', 2),
Label( 'rongwei-RX5', 64, 'SUV', 2),
Label( 'sanling-oulande', 65, 'SUV', 2),
Label( 'sikeda-SUV', 66, 'SUV', 2),
Label( 'Skoda_Fabia-2011', 67, 'SUV', 2),
Label( 'xiandai-i25-2016', 68, 'SUV', 2),
Label( 'yingfeinidi-qx80', 69, 'SUV', 2),
Label( 'yingfeinidi-SUV', 70, 'SUV', 2),
Label( 'benchi-SUR', 71, 'SUV', 2),
Label( 'biyadi-tang', 72, 'SUV', 2),
Label( 'changan-CS35-2012', 73, 'SUV', 2),
Label( 'changan-cs5', 74, 'SUV', 2),
Label( 'changcheng-H6-2016', 75, 'SUV', 2),
Label( 'dazhong-SUV', 76, 'SUV', 2),
Label( 'dongfeng-fengguang-S560', 77, 'SUV', 2),
Label( 'dongfeng-fengxing-SX6', 78, 'SUV', 2)
]
#--------------------------------------------------------------------------------
# Create dictionaries for a fast lookup
#--------------------------------------------------------------------------------
# Please refer to the main method below for example usages!
# name to label object
car_name2id = {label.name: label for label in models}
car_id2name = {label.id: label for label in models}
#--------------------------------------------------------------------------------
# Main for testing
#--------------------------------------------------------------------------------