Getting a list of all known classes of vgg-16 in keras
I think if you do something like this:
vgg16 = keras.applications.vgg16.VGG16(include_top=True,
weights='imagenet',
input_tensor=None,
input_shape=None,
pooling=None,
classes=1000)
vgg16.decode_predictions(np.arange(1000), top=1000)
Substitute your prediction array for np.arange(1000). Untested code so far.
Link to training labels here I think: http://image-net.org/challenges/LSVRC/2014/browse-synsets
You could use decode_predictions and pass the total number of classes in the top=1000
parameter (only its default value is 5).
Or you could look at how Keras does this internally: It downloads the file imagenet_class_index.json
(and usually caches it in ~/.keras/models/
). This is a simple json file containing all class labels.