-
Notifications
You must be signed in to change notification settings - Fork 0
/
cifar_metadata.py
270 lines (265 loc) · 7.31 KB
/
cifar_metadata.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
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
"""Metadata for the CIFAR-100 hierarchy."""
CLASS_LABELS = ['apple', 'aquarium_fish', 'baby', 'bear', 'beaver', 'bed', 'bee', 'beetle', 'bicycle', 'bottle', 'bowl', 'boy', 'bridge', 'bus', 'butterfly', 'camel', 'can', 'castle', 'caterpillar', 'cattle', 'chair', 'chimpanzee', 'clock', 'cloud', 'cockroach', 'couch', 'crab', 'crocodile', 'cup', 'dinosaur', 'dolphin', 'elephant', 'flatfish', 'forest', 'fox', 'girl', 'hamster', 'house', 'kangaroo', 'keyboard', 'lamp', 'lawn_mower', 'leopard', 'lion', 'lizard', 'lobster', 'man', 'maple_tree', 'motorcycle', 'mountain', 'mouse', 'mushroom', 'oak_tree', 'orange', 'orchid', 'otter', 'palm_tree', 'pear', 'pickup_truck', 'pine_tree', 'plain', 'plate', 'poppy', 'porcupine', 'possum', 'rabbit', 'raccoon', 'ray', 'road', 'rocket', 'rose', 'sea', 'seal', 'shark', 'shrew', 'skunk', 'skyscraper', 'snail', 'snake', 'spider', 'squirrel', 'streetcar', 'sunflower', 'sweet_pepper', 'table', 'tank', 'telephone', 'television', 'tiger', 'tractor', 'train', 'trout', 'tulip', 'turtle', 'wardrobe', 'whale', 'willow_tree', 'wolf', 'woman', 'worm']
SUPERCLASS_LABELS = ['aquatic_mammals', 'fish', 'flowers', 'food_containers', 'fruit_and_vegetables', 'household_electrical_devices', 'household_furniture', 'insects', 'large_carnivores', 'large_man-made_outdoor_things', 'large_natural_outdoor_scenes', 'large_omnivores_and_herbivores', 'medium_mammals', 'non-insect_invertebrates', 'people', 'reptiles', 'small_mammals', 'trees', 'vehicles_1', 'vehicles_2']
SUPERCLASS_TO_CLASS = {
'aquatic_mammals': ['beaver', 'dolphin', 'otter', 'seal', 'whale'],
'fish': ['aquarium_fish', 'flatfish', 'ray', 'shark', 'trout'],
'flowers': ['orchid', 'poppy', 'rose', 'sunflower', 'tulip'],
'food_containers': ['bottle', 'bowl', 'can', 'cup', 'plate'],
'fruit_and_vegetables': ['apple',
'mushroom',
'orange',
'pear',
'sweet_pepper'],
'household_electrical_devices': ['clock',
'keyboard',
'lamp',
'telephone',
'television'],
'household_furniture': ['bed', 'chair', 'couch', 'table', 'wardrobe'],
'insects': ['bee', 'beetle', 'butterfly', 'caterpillar', 'cockroach'],
'large_carnivores': ['bear', 'leopard', 'lion', 'tiger', 'wolf'],
'large_man-made_outdoor_things': ['bridge',
'castle',
'house',
'road',
'skyscraper'],
'large_natural_outdoor_scenes': ['cloud',
'forest',
'mountain',
'plain',
'sea'],
'large_omnivores_and_herbivores': ['camel',
'cattle',
'chimpanzee',
'elephant',
'kangaroo'],
'medium_mammals': ['fox', 'porcupine', 'possum', 'raccoon', 'skunk'],
'non-insect_invertebrates': ['crab', 'lobster', 'snail', 'spider', 'worm'],
'people': ['baby', 'boy', 'girl', 'man', 'woman'],
'reptiles': ['crocodile', 'dinosaur', 'lizard', 'snake', 'turtle'],
'small_mammals': ['hamster', 'mouse', 'rabbit', 'shrew', 'squirrel'],
'trees': ['maple_tree', 'oak_tree', 'palm_tree', 'pine_tree', 'willow_tree'],
'vehicles_1': ['bicycle', 'bus', 'motorcycle', 'pickup_truck', 'train'],
'vehicles_2': ['lawn_mower', 'rocket', 'streetcar', 'tank', 'tractor'],
0: [4, 30, 55, 72, 95],
1: [1, 32, 67, 73, 91],
2: [54, 62, 70, 82, 92],
3: [9, 10, 16, 28, 61],
4: [0, 51, 53, 57, 83],
5: [22, 39, 40, 86, 87],
6: [5, 20, 25, 84, 94],
7: [6, 7, 14, 18, 24],
8: [3, 42, 43, 88, 97],
9: [12, 17, 37, 68, 76],
10: [23, 33, 49, 60, 71],
11: [15, 19, 21, 31, 38],
12: [34, 63, 64, 66, 75],
13: [26, 45, 77, 79, 99],
14: [2, 11, 35, 46, 98],
15: [27, 29, 44, 78, 93],
16: [36, 50, 65, 74, 80],
17: [47, 52, 56, 59, 96],
18: [8, 13, 48, 58, 90],
19: [41, 69, 81, 85, 89]
}
CLASS_TO_SUPERCLASS = {'beaver': 'aquatic_mammals',
'dolphin': 'aquatic_mammals',
'otter': 'aquatic_mammals',
'seal': 'aquatic_mammals',
'whale': 'aquatic_mammals',
'aquarium_fish': 'fish',
'flatfish': 'fish',
'ray': 'fish',
'shark': 'fish',
'trout': 'fish',
'orchid': 'flowers',
'poppy': 'flowers',
'rose': 'flowers',
'sunflower': 'flowers',
'tulip': 'flowers',
'bottle': 'food_containers',
'bowl': 'food_containers',
'can': 'food_containers',
'cup': 'food_containers',
'plate': 'food_containers',
'apple': 'fruit_and_vegetables',
'mushroom': 'fruit_and_vegetables',
'orange': 'fruit_and_vegetables',
'pear': 'fruit_and_vegetables',
'sweet_pepper': 'fruit_and_vegetables',
'clock': 'household_electrical_devices',
'keyboard': 'household_electrical_devices',
'lamp': 'household_electrical_devices',
'telephone': 'household_electrical_devices',
'television': 'household_electrical_devices',
'bed': 'household_furniture',
'chair': 'household_furniture',
'couch': 'household_furniture',
'table': 'household_furniture',
'wardrobe': 'household_furniture',
'bee': 'insects',
'beetle': 'insects',
'butterfly': 'insects',
'caterpillar': 'insects',
'cockroach': 'insects',
'bear': 'large_carnivores',
'leopard': 'large_carnivores',
'lion': 'large_carnivores',
'tiger': 'large_carnivores',
'wolf': 'large_carnivores',
'bridge': 'large_man-made_outdoor_things',
'castle': 'large_man-made_outdoor_things',
'house': 'large_man-made_outdoor_things',
'road': 'large_man-made_outdoor_things',
'skyscraper': 'large_man-made_outdoor_things',
'cloud': 'large_natural_outdoor_scenes',
'forest': 'large_natural_outdoor_scenes',
'mountain': 'large_natural_outdoor_scenes',
'plain': 'large_natural_outdoor_scenes',
'sea': 'large_natural_outdoor_scenes',
'camel': 'large_omnivores_and_herbivores',
'cattle': 'large_omnivores_and_herbivores',
'chimpanzee': 'large_omnivores_and_herbivores',
'elephant': 'large_omnivores_and_herbivores',
'kangaroo': 'large_omnivores_and_herbivores',
'fox': 'medium_mammals',
'porcupine': 'medium_mammals',
'possum': 'medium_mammals',
'raccoon': 'medium_mammals',
'skunk': 'medium_mammals',
'crab': 'non-insect_invertebrates',
'lobster': 'non-insect_invertebrates',
'snail': 'non-insect_invertebrates',
'spider': 'non-insect_invertebrates',
'worm': 'non-insect_invertebrates',
'baby': 'people',
'boy': 'people',
'girl': 'people',
'man': 'people',
'woman': 'people',
'crocodile': 'reptiles',
'dinosaur': 'reptiles',
'lizard': 'reptiles',
'snake': 'reptiles',
'turtle': 'reptiles',
'hamster': 'small_mammals',
'mouse': 'small_mammals',
'rabbit': 'small_mammals',
'shrew': 'small_mammals',
'squirrel': 'small_mammals',
'maple_tree': 'trees',
'oak_tree': 'trees',
'palm_tree': 'trees',
'pine_tree': 'trees',
'willow_tree': 'trees',
'bicycle': 'vehicles_1',
'bus': 'vehicles_1',
'motorcycle': 'vehicles_1',
'pickup_truck': 'vehicles_1',
'train': 'vehicles_1',
'lawn_mower': 'vehicles_2',
'rocket': 'vehicles_2',
'streetcar': 'vehicles_2',
'tank': 'vehicles_2',
'tractor': 'vehicles_2',
4: 0,
30: 0,
55: 0,
72: 0,
95: 0,
1: 1,
32: 1,
67: 1,
73: 1,
91: 1,
54: 2,
62: 2,
70: 2,
82: 2,
92: 2,
9: 3,
10: 3,
16: 3,
28: 3,
61: 3,
0: 4,
51: 4,
53: 4,
57: 4,
83: 4,
22: 5,
39: 5,
40: 5,
86: 5,
87: 5,
5: 6,
20: 6,
25: 6,
84: 6,
94: 6,
6: 7,
7: 7,
14: 7,
18: 7,
24: 7,
3: 8,
42: 8,
43: 8,
88: 8,
97: 8,
12: 9,
17: 9,
37: 9,
68: 9,
76: 9,
23: 10,
33: 10,
49: 10,
60: 10,
71: 10,
15: 11,
19: 11,
21: 11,
31: 11,
38: 11,
34: 12,
63: 12,
64: 12,
66: 12,
75: 12,
26: 13,
45: 13,
77: 13,
79: 13,
99: 13,
2: 14,
11: 14,
35: 14,
46: 14,
98: 14,
27: 15,
29: 15,
44: 15,
78: 15,
93: 15,
36: 16,
50: 16,
65: 16,
74: 16,
80: 16,
47: 17,
52: 17,
56: 17,
59: 17,
96: 17,
8: 18,
13: 18,
48: 18,
58: 18,
90: 18,
41: 19,
69: 19,
81: 19,
85: 19,
89: 19}