Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,7 +34,7 @@ feature_extractor = ViTFeatureExtractor.from_pretrained(model_id)
|
|
| 34 |
|
| 35 |
# Predict function
|
| 36 |
def predict(image):
|
| 37 |
-
img =
|
| 38 |
model.eval()
|
| 39 |
pixel_values = feature_extractor(images=[img], return_tensors="pt").pixel_values
|
| 40 |
with torch.no_grad():
|
|
|
|
| 34 |
|
| 35 |
# Predict function
|
| 36 |
def predict(image):
|
| 37 |
+
img = image.convert('RGB')
|
| 38 |
model.eval()
|
| 39 |
pixel_values = feature_extractor(images=[img], return_tensors="pt").pixel_values
|
| 40 |
with torch.no_grad():
|