Imagenet classes

I found a map of id -> label https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a .
So for example

with open("imagenet1000_clsid_to_human.txt") as f:
    idx2label = eval(f.read())

for idx in out[0].sort()[1][-10:]:
    print(idx2label(idx))

will work, though eval may be not good way.

3 Likes