Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,7 +54,7 @@ def inference(img):
|
|
| 54 |
# for name, prob in zip(pred_class_names, pred_class_probs):
|
| 55 |
# res += f"[{prob:2.2f}%]\t{name}\n"
|
| 56 |
|
| 57 |
-
return {imagenet_id_to_classname[str(i
|
| 58 |
|
| 59 |
inputs = gr.inputs.Image(type='pil')
|
| 60 |
# outputs = gr.outputs.Textbox(label="Output")
|
|
|
|
| 54 |
# for name, prob in zip(pred_class_names, pred_class_probs):
|
| 55 |
# res += f"[{prob:2.2f}%]\t{name}\n"
|
| 56 |
|
| 57 |
+
return {imagenet_id_to_classname[str(i)]: float(prediction[i]) for i in range(1000)}
|
| 58 |
|
| 59 |
inputs = gr.inputs.Image(type='pil')
|
| 60 |
# outputs = gr.outputs.Textbox(label="Output")
|