Is there any way I can use pretrained Imagenet models in Fast.ai 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)

Example:

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 Fast.ai?

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

1 Like

Yes, use the classify() function here: