Is there any way I can use pretrained Imagenet models in to label images?

Basically do the following:

Take an image as an input.

Output a list of possible classes and their probabilities as output:

Without doing any training (basically using the pretrained Imagenet models)


Tree: 0.3
Person: 0.3
Wolf: 0.3
Mushroom: 0.05
Frog: 0.05

I know how to do that in Keras, example here.

Is there any way to achieve THE EXACT SAME RESULTS as above using Pytorch or

The closest thing I’ve found to this in Pytorch.


Hey @xjdeng!

In the meantime, have you found a way of doing it in

I started learning and I’m facing the same question as you did 8mo ago.

Thank you!

~ Leo

Yes, use the classify() function here:

1 Like