Image classification
In this exercise, you will use the same flickr dataset as previously, which has 30,000 images and associated captions. Now you will classify the image using a pretrained model.

The sample image (image) and pipeline module (pipeline) have been loaded.
Questo esercizio fa parte del corso
Multi-Modal Models with Hugging Face
Istruzioni dell'esercizio
- Load the
image-classificationpipeline withgoogle/mobilenet_v2_1.0_224pretrained model. - Use the pipeline to predict the class of the sample image.
- Print the first (highest probability)
label.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# Load the image-classification pipeline
pipe = ____
# Use the pipeline to predict the class of the sample image
pred = ____
# Print the first (highest probability) label
print("Predicted class:", ____)