Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -106,11 +106,12 @@ def main():
|
|
| 106 |
|
| 107 |
if pred_button:
|
| 108 |
|
| 109 |
-
outputs =
|
| 110 |
_, y_hat = outputs.max(1)
|
| 111 |
-
predicted_idx = str(y_hat.item())
|
| 112 |
-
right_column.title("Prediction")
|
| 113 |
-
right_column.write(predicted_idx)
|
|
|
|
| 114 |
|
| 115 |
|
| 116 |
if __name__ == '__main__':
|
|
|
|
| 106 |
|
| 107 |
if pred_button:
|
| 108 |
|
| 109 |
+
outputs = model.predict(image)
|
| 110 |
_, y_hat = outputs.max(1)
|
| 111 |
+
# predicted_idx = str(y_hat.item())
|
| 112 |
+
# right_column.title("Prediction")
|
| 113 |
+
# right_column.write(predicted_idx)
|
| 114 |
+
right_column.write(decode_predictions(outputs, top=3)[0])
|
| 115 |
|
| 116 |
|
| 117 |
if __name__ == '__main__':
|