Git Product home page Git Product logo

imagenet-simple-labels's Introduction

Simpler human-readable labels for ImageNet Build Status

The file imagenet-simple-labels.json contains simple, short, human-readable labels for the 1000 ImageNet classes.

There are similar files out there with human-readable labels for ImageNet classes (see below for a comparison). The goal of this project is to have simple, short, human-readable, and meaningful labels, without being restricted to choosing one of the synonyms out of the synset for each ImageNet class. These label names were chosen by looking at the synset for each ImageNet class and either choosing one of the synonyms or choosing a new description altogether, based on a couple guiding principles:

  • Using Wikipedia or Google Search for canonicalization
  • Preferring American English over British English
  • Preserving genericized trademarks (e.g. keeping "Band-Aid" rather than replacing it with "adhesive bandage")

Depending on your use case, this may or may not be for you. If you're looking for more "official" labels (such as those that always choose synonyms out of the synsets rather than sometimes using new descriptions), consider some of the alternatives compared below.

Comparison

  • ImageNet original labels. Each of the 1000 ImageNet classes corresponds to a WordNet synset (a set of synonyms). These are the "official" labels. Here is a file with a mapping of class IDs to these labels.
  • Keras labels. Keras uses this data for its human-readable labels. The labels consist of the first synonym from each synset (with spaces replaced with underscores).

Below is a table comparing ImageNet labels and Keras labels with our labels. The table contains hand-picked examples to illustrate differences.

ID ImageNet Keras Simple (this repo)
87 African grey, African gray, Psittacus erithacus African_grey grey parrot
97 drake drake duck
134 crane crane crane (bird)
156 Blenheim spaniel Blenheim_spaniel King Charles Spaniel
383 Madagascar cat, ring-tailed lemur, Lemur catta Madagascar_cat ring-tailed lemur
439 bearskin, busby, shako bearskin military cap
517 crane crane crane (machine)
628 liner, ocean liner liner ocean liner
667 mortarboard mortarboard square academic cap
699 panpipe, pandean pipe, syrinx panpipe pan flute
913 wreck wreck shipwreck
930 French loaf French_loaf baguette

Usage

Below is a Python code sample showing how the label data can be used.

import json

with open('imagenet-simple-labels.json') as f:
    labels = json.load(f)

def class_id_to_label(i):
    return labels[i]

print(class_id_to_label(924)) # prints "guacamole"

License

Public domain.

imagenet-simple-labels's People

Contributors

anishathalye avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.