Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ labels = []
|
|
25 |
def predict(img):
|
26 |
img = PILImage.create(img)
|
27 |
|
28 |
-
inputs = feature_extractor(images=
|
29 |
logits = model(**inputs)['logits'].cpu().detach().numpy()
|
30 |
predictions = np.argmax(logits, axis=1)
|
31 |
predicted_labels = [labels[prediction] for prediction in predictions]
|
|
|
25 |
def predict(img):
|
26 |
img = PILImage.create(img)
|
27 |
|
28 |
+
inputs = feature_extractor(images=img, return_tensors="pt")
|
29 |
logits = model(**inputs)['logits'].cpu().detach().numpy()
|
30 |
predictions = np.argmax(logits, axis=1)
|
31 |
predicted_labels = [labels[prediction] for prediction in predictions]
|