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.

2 Likes

Hey @xjdeng!

In the meantime, have you found a way of doing it in fast.ai?

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

Thank you!

~ Leo

Yes, use the classify() function here:

1 Like