Views
No views yet
1from transformers import pipeline
2from PIL import Image
3
4# Create pipeline
5classifier = pipeline("image-classification", model="YOUR_USERNAME/garbage-classification")
6
7# Load image
8image = Image.open("test_image.jpg")
9
10# Make prediction
11result = classifier(image)
12print(f"Prediction: {result[0]['label']}, Confidence: {result[0]['score']:.2f}")