-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvariable.py
More file actions
205 lines (182 loc) · 14.6 KB
/
Copy pathvariable.py
File metadata and controls
205 lines (182 loc) · 14.6 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
### BGR format ###
# for MSCOCO-POSE
COLORMAP19 = {0: [255, 0, 0], 1: [255, 85, 0], 2: [255, 170, 0], 3: [255, 255, 0], 4: [170, 255, 0],
5: [85, 255, 0], 6: [0, 255, 0], 7: [0, 255, 85], 8: [0, 255, 170], 9: [0, 255, 255],
10: [0, 170, 255], 11: [0, 85, 255], 12: [0, 0, 255], 13: [85, 0, 255], 14: [170, 0, 255],
15: [255, 0, 255], 16: [255, 0, 170], 17: [255, 0, 85], 18: [255, 0, 0]}
# for MSCOCO-POSE
COLORMAP20 = {0: [0, 0, 0], 1: [0, 128, 0], 2: [0, 0, 128], 3: [0, 128, 128], 4: [128, 0, 0], 5: [128, 0, 128],
6: [128, 128, 0], 7: [128, 128, 128], 8: [0, 0, 64], 9: [0, 0, 192], 10: [0, 128, 64],
11: [0, 128, 192], 12: [128, 0, 64], 13: [128, 0, 192], 14: [128, 128, 64], 15: [128, 128, 192],
16: [0, 64, 0], 17: [0, 64, 128], 18: [0, 192, 0], 19: [0, 192, 128], 20: [128, 64, 0],
255: [255, 255, 255]}
# for PSACAL VOC
COLORMAP21 = {0: [0, 0, 0], 1: [0, 0, 128], 2: [0, 128, 0], 3: [0, 128, 128], 4: [128, 0, 0], 5: [128, 0, 128],
6: [128, 128, 0], 7: [128, 128, 128], 8: [0, 0, 64], 9: [0, 0, 192], 10: [0, 128, 64],
11: [0, 128, 192], 12: [128, 0, 64], 13: [128, 0, 192], 14: [128, 128, 64], 15: [128, 128, 192],
16: [0, 64, 0], 17: [0, 64, 128], 18: [0, 192, 0], 19: [0, 192, 128], 20: [128, 64, 0],
255: [255, 255, 255]}
# for MSCOCO
COLORMAP81 = {0: [0, 0, 0], 1: [28, 13, 251], 2: [27, 25, 251], 3: [28, 40, 252], 4: [29, 57, 252], 5: [31, 72, 251],
6: [32, 95, 253], 7: [33, 112, 253], 8: [36, 130, 253], 9: [38, 147, 253], 10: [42, 170, 253],
11: [44, 188, 253], 12: [48, 206, 254], 13: [50, 223, 255], 14: [54, 243, 252], 15: [56, 253, 245],
16: [55, 254, 227], 17: [52, 253, 210], 18: [51, 253, 186], 19: [51, 253, 170], 20: [49, 253, 154],
21: [50, 253, 136], 22: [48, 253, 114], 23: [48, 253, 100], 24: [48, 253, 84], 25: [47, 253, 70],
26: [48, 253, 54], 27: [47, 253, 45], 28: [48, 253, 44], 29: [54, 253, 41], 30: [62, 253, 42],
31: [78, 253, 42], 32: [92, 253, 43], 33: [107, 253, 41], 34: [122, 253, 42], 35: [143, 253, 41],
36: [160, 253, 42], 37: [177, 254, 43], 38: [195, 254, 42], 39: [217, 254, 44], 40: [233, 254, 45],
41: [251, 254, 45], 42: [253, 240, 42], 43: [252, 217, 37], 44: [252, 200, 34], 45: [251, 183, 30],
46: [253, 165, 27], 47: [251, 143, 25], 48: [251, 126, 21], 49: [250, 109, 18], 50: [251, 93, 16],
51: [251, 73, 14], 52: [251, 59, 12], 53: [251, 47, 12], 54: [251, 40, 13], 55: [252, 36, 17],
56: [251, 36, 35], 57: [251, 36, 51], 58: [251, 36, 69], 59: [250, 36, 85], 60: [251, 37, 108],
61: [251, 37, 126], 62: [251, 37, 143], 63: [250, 37, 160], 64: [251, 39, 183], 65: [252, 39, 202],
66: [252, 39, 218], 67: [252, 40, 237], 68: [242, 39, 250], 69: [228, 36, 251], 70: [211, 33, 252],
71: [194, 32, 252], 72: [171, 27, 253], 73: [154, 25, 252], 74: [136, 23, 251], 75: [120, 20, 252],
76: [97, 18, 253], 77: [82, 16, 252], 78: [65, 16, 252], 79: [50, 14, 252], 80: [39, 13, 251],
255: [255, 255, 255]}
# for ADE20k
COLORMAP151 = {0: [0, 0, 0], 1: [120, 120, 120], 2: [180, 120, 120], 3: [6, 230, 230], 4: [80, 50, 50], 5: [4, 200, 3],
6: [120, 120, 80], 7: [140, 140, 140], 8: [204, 5, 255], 9: [230, 230, 230], 10: [4, 250, 7],
11: [224, 5, 255], 12: [235, 255, 7], 13: [150, 5, 61], 14: [120, 120, 70], 15: [8, 255, 51],
16: [255, 6, 82], 17: [143, 255, 140], 18: [204, 255, 4], 19: [255, 51, 7], 20: [204, 70, 3],
21: [0, 102, 200], 22: [61, 230, 250], 23: [255, 6, 51], 24: [11, 102, 255], 25: [255, 7, 71],
26: [255, 9, 224], 27: [9, 7, 230], 28: [220, 220, 220], 29: [255, 9, 92], 30: [112, 9, 255],
31: [8, 255, 214], 32: [7, 255, 224], 33: [255, 184, 6], 34: [10, 255, 71], 35: [255, 41, 10],
36: [7, 255, 255], 37: [224, 255, 8], 38: [102, 8, 255], 39: [255, 61, 6], 40: [255, 194, 7],
41: [255, 122, 8], 42: [0, 255, 20], 43: [255, 8, 41], 44: [255, 5, 153], 45: [6, 51, 255],
46: [235, 12, 255], 47: [160, 150, 20], 48: [0, 163, 255], 49: [140, 140, 140], 50: [250, 10, 15],
51: [20, 255, 0], 52: [31, 255, 0], 53: [255, 31, 0], 54: [255, 224, 0], 55: [153, 255, 0],
56: [0, 0, 255], 57: [255, 71, 0], 58: [0, 235, 255], 59: [0, 173, 255], 60: [31, 0, 255],
61: [11, 200, 200], 62: [255, 82, 0], 63: [0, 255, 245], 64: [0, 61, 255], 65: [0, 255, 112],
66: [0, 255, 133], 67: [255, 0, 0], 68: [255, 163, 0], 69: [255, 102, 0], 70: [194, 255, 0],
71: [0, 143, 255], 72: [51, 255, 0], 73: [0, 82, 255], 74: [0, 255, 41], 75: [0, 255, 173],
76: [10, 0, 255], 77: [173, 255, 0], 78: [0, 255, 153], 79: [255, 92, 0], 80: [255, 0, 255],
81: [255, 0, 245], 82: [255, 0, 102], 83: [255, 173, 0], 84: [255, 0, 20], 85: [255, 184, 184],
86: [0, 31, 255], 87: [0, 255, 61], 88: [0, 71, 255], 89: [255, 0, 204], 90: [0, 255, 194],
91: [0, 255, 82], 92: [0, 10, 255], 93: [0, 112, 255], 94: [51, 0, 255], 95: [0, 194, 255],
96: [0, 122, 255], 97: [0, 255, 163], 98: [255, 153, 0], 99: [0, 255, 10], 100: [255, 112, 0],
101: [143, 255, 0], 102: [82, 0, 255], 103: [163, 255, 0], 104: [255, 235, 0], 105: [8, 184, 170],
106: [133, 0, 255], 107: [0, 255, 92], 108: [184, 0, 255], 109: [255, 0, 31], 110: [0, 184, 255],
111: [0, 214, 255], 112: [255, 0, 112], 113: [92, 255, 0], 114: [0, 224, 255], 115: [112, 224, 255],
116: [70, 184, 160], 117: [163, 0, 255], 118: [153, 0, 255], 119: [71, 255, 0], 120: [255, 0, 163],
121: [255, 204, 0], 122: [255, 0, 143], 123: [0, 255, 235], 124: [133, 255, 0], 125: [255, 0, 235],
126: [245, 0, 255], 127: [255, 0, 122], 128: [255, 245, 0], 129: [10, 190, 212], 130: [214, 255, 0],
131: [0, 204, 255], 132: [20, 0, 255], 133: [255, 255, 0], 134: [0, 153, 255], 135: [0, 41, 255],
136: [0, 255, 204], 137: [41, 0, 255], 138: [41, 255, 0], 139: [173, 0, 255], 140: [0, 245, 255],
141: [71, 0, 255], 142: [122, 0, 255], 143: [0, 255, 184], 144: [0, 92, 255], 145: [184, 255, 0],
146: [0, 133, 255], 147: [255, 214, 0], 148: [25, 194, 194], 149: [102, 255, 0], 150: [92, 0, 255],
255: [255, 255, 255]}
POSE19_LINKPAIR = [[1, 2], [1, 5], [2, 3], [3, 4], [5, 6], [6, 7], [1, 18], [18, 8], [18, 11], [8, 9], [9, 10],
[11, 12], [12, 13], [1, 0], [0, 14], [14, 16], [0, 15], [15, 17]]
MASKRCNN_POSE19_LINKPAIR = [[0, 1], [1, 3], [0, 2], [2, 4], [0, 17], [17, 5], [5, 7], [7, 9], [17, 6], [6, 8], [8, 10],
[17, 18], [18, 11], [11, 13], [13, 15], [18, 12], [12, 14], [14, 16]]
# for PSACAL VOC
VOC_CLASS21 = ('__background__', # always index 0
'aeroplane', 'bicycle', 'bird', 'boat',
'bottle', 'bus', 'car', 'cat', 'chair',
'cow', 'diningtable', 'dog', 'horse',
'motorbike', 'person', 'pottedplant',
'sheep', 'sofa', 'train', 'tvmonitor')
# for MSCOCO
COCO_CLASS81 = ('__background__', # always index 0
'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
'train', 'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign',
'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep',
'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack',
'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis',
'snowboard', 'sports ball', 'kite', 'baseball bat', 'baseball glove',
'skateboard', 'surfboard', 'tennis racket', 'bottle', 'wine glass',
'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple',
'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza',
'donut', 'cake', 'chair', 'couch', 'potted plant', 'bed',
'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote',
'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink',
'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear',
'hair drier', 'toothbrush')
# for ADE20k
ADE_CLASS151 = ('__background__', # always index 0
'wall', 'building', 'sky', 'floor,', 'tree', 'ceiling', 'road', 'bed', 'windowpane',
'grass', 'cabinet', 'sidewalk', 'person', 'earth', 'door', 'table', 'mountain',
'plant', 'curtain', 'chair', 'car', 'water', 'painting', 'sofa', 'shelt', 'house',
'sea', 'mirror', 'rug', 'field', 'armchair', 'seat', 'fence', 'desk', 'rock',
'wardrobe', 'lamp', 'bathub', 'railing', 'cushion', 'base', 'box', 'column',
'signboard', 'chest', 'counter', 'sand', 'sink', 'skyscrapter', 'fireplace',
'refrigerator', 'grandstand', 'path', 'stairs', 'runway', 'case', 'pool',
'pillow', 'sreen door', 'stair way', 'river', 'brige', 'bookcase', 'blind',
'coffee', 'toilet', 'flower', 'book', 'hill', 'bench', 'countertop', 'stove',
'palm', 'kitchen island', 'computer', 'swivel chair', 'boat', 'bar', 'arcade machine',
'hovel', 'bus', 'towel', 'light', 'truck', 'tower', 'chandelier', 'awning',
'street light', 'booth', 'television', 'airplane', 'dirt track', 'apparel', 'pole',
'land', 'bannister', 'escalator', 'ottoman', 'bottle', 'buffet', 'poster', 'stage',
'van', 'ship', 'fountain', 'conveyer belt', 'canopy', 'washer', 'playing',
'swimming pool', 'stool', 'barrel', 'basket', 'waterfall', 'tent', 'bag', 'minibike',
'cradle', 'oven', 'ball', 'food', 'step', 'tank', 'trade name', 'microwave', 'pot',
'animal', 'bicycle', 'lake', 'dishwasher', 'screen', 'blanket', 'scuplture', 'hood',
'sconce', 'vase', 'trffice light', 'tray', 'ashcan', 'fan', 'pier', 'crt screen',
'plate', 'monitor', 'bulletion board', 'shower', 'radiator', 'glass', 'clock', 'flag')
# for ILSVRC-DET
ILSVRC_CLASS200 = ('__background__', # always index 0
'n02672831', 'n02691156', 'n02219486', 'n02419796', 'n07739125',
'n02454379', 'n07718747', 'n02764044', 'n02766320', 'n02769748',
'n07693725', 'n02777292', 'n07753592', 'n02786058', 'n02787622',
'n02799071', 'n02802426', 'n02807133', 'n02815834', 'n02131653',
'n02206856', 'n07720875', 'n02828884', 'n02834778', 'n02840245',
'n01503061', 'n02870880', 'n02883205', 'n02879718', 'n02880940',
'n02892767', 'n07880968', 'n02924116', 'n02274259', 'n02437136',
'n02951585', 'n02958343', 'n02970849', 'n02402425', 'n02992211',
'n01784675', 'n03000684', 'n03001627', 'n03017168', 'n03062245',
'n03063338', 'n03085013', 'n03793489', 'n03109150', 'n03128519',
'n03134739', 'n03141823', 'n07718472', 'n03797390', 'n03188531',
'n03196217', 'n03207941', 'n02084071', 'n02121808', 'n02268443',
'n03249569', 'n03255030', 'n03271574', 'n02503517', 'n03314780',
'n07753113', 'n03337140', 'n03991062', 'n03372029', 'n02118333',
'n03394916', 'n01639765', 'n03400231', 'n02510455', 'n01443537',
'n03445777', 'n03445924', 'n07583066', 'n03467517', 'n03483316',
'n03476991', 'n07697100', 'n03481172', 'n02342885', 'n03494278',
'n03495258', 'n03124170', 'n07714571', 'n03513137', 'n02398521',
'n03535780', 'n02374451', 'n07697537', 'n03584254', 'n01990800',
'n01910747', 'n01882714', 'n03633091', 'n02165456', 'n03636649',
'n03642806', 'n07749582', 'n02129165', 'n03676483', 'n01674464',
'n01982650', 'n03710721', 'n03720891', 'n03759954', 'n03761084',
'n03764736', 'n03770439', 'n02484322', 'n03790512', 'n07734744',
'n03804744', 'n03814639', 'n03838899', 'n07747607', 'n02444819',
'n03908618', 'n03908714', 'n03916031', 'n00007846', 'n03928116',
'n07753275', 'n03942813', 'n03950228', 'n07873807', 'n03958227',
'n03961711', 'n07768694', 'n07615774', 'n02346627', 'n03995372',
'n07695742', 'n04004767', 'n04019541', 'n04023962', 'n04026417',
'n02324045', 'n04039381', 'n01495701', 'n02509815', 'n04070727',
'n04074963', 'n04116512', 'n04118538', 'n04118776', 'n04131690',
'n04141076', 'n01770393', 'n04154565', 'n02076196', 'n02411705',
'n04228054', 'n02445715', 'n01944390', 'n01726692', 'n04252077',
'n04252225', 'n04254120', 'n04254680', 'n04256520', 'n04270147',
'n02355227', 'n02317335', 'n04317175', 'n04330267', 'n04332243',
'n07745940', 'n04336792', 'n04356056', 'n04371430', 'n02395003',
'n04376876', 'n04379243', 'n04392985', 'n04409515', 'n01776313',
'n04591157', 'n02129604', 'n04442312', 'n06874185', 'n04468005',
'n04487394', 'n03110669', 'n01662784', 'n03211117', 'n04509417',
'n04517823', 'n04536866', 'n04540053', 'n04542943', 'n04554684',
'n04557648', 'n04530566', 'n02062744', 'n04591713', 'n02391049')
FACE_CLASS = ('__background__', # always index 0
'face')
PERSON_CLASS = ('__background__', # always index 0
'person')
HAND_CLASS = ('__background__', # always index 0
'hand')
PERSONPART_CLASS = ('__background__', # always index 0
'person', 'face', 'hand')
VEHICLE_CLASS = ('__background__', # always index 0
'car', 'bus', 'truck', 'motorcycle', 'bicycle')
# person = pedestrian + rider + driver
SHANXI7_CLASS = ('__background__', # always index 0
'car', 'truck', 'bus', 'motorcycle', 'bicycle', 'person')
SHANXI9_CLASS = ('__background__', # always index 0
'car', 'truck', 'bus', 'motorcycle', 'bicycle', 'pedestrian', 'rider', 'driver')
CELLPHONE_CLASS = ('__background__', # always index 0
'cellphone')
CELLPHONE2_CLASS = ('__background__', # always index 0
'cellphone', 'person')
def dict2list(d):
l = []
for i in d.keys():
l.append(d[i])
return l