Skip to content

Instantly share code, notes, and snippets.

@harritaylor
Created September 18, 2020 08:46
Show Gist options
  • Save harritaylor/7c900b96311dc2b88f73200039ff17f3 to your computer and use it in GitHub Desktop.
Save harritaylor/7c900b96311dc2b88f73200039ff17f3 to your computer and use it in GitHub Desktop.
I couldn't find a listing of CIFAR100 labels in order anywhere. Here they are 🎁
def unpickle(file):
    import pickle
    with open(file, 'rb') as fo:
        dict = pickle.load(fo, encoding='bytes')
        return dict
        
meta = unpickle("./cifar-100-python/meta")

fine_labels = [lbl.decode("utf-8") for lbl in meta[b'fine_label_names']]
coarse_labels = [lbl.decode("utf-8") for lbl in meta[b'coarse_label_names']]

Fine 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']

Coarse 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']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment