Update app.py
Browse files
app.py
CHANGED
|
@@ -4,8 +4,8 @@ from transformers import ViTForImageClassification, ViTFeatureExtractor
|
|
| 4 |
from PIL import Image
|
| 5 |
|
| 6 |
# Load model and feature extractor
|
| 7 |
-
model = ViTForImageClassification.from_pretrained('
|
| 8 |
-
feature_extractor = ViTFeatureExtractor.from_pretrained('
|
| 9 |
|
| 10 |
# Move to GPU if available
|
| 11 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 4 |
from PIL import Image
|
| 5 |
|
| 6 |
# Load model and feature extractor
|
| 7 |
+
model = ViTForImageClassification.from_pretrained('Dhahlan2000/fruit_and_veg_chategorizer', num_labels=10, ignore_mismatched_sizes=True)
|
| 8 |
+
feature_extractor = ViTFeatureExtractor.from_pretrained('Dhahlan2000/fruit_and_veg_chategorizer')
|
| 9 |
|
| 10 |
# Move to GPU if available
|
| 11 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|