Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -52,7 +52,7 @@ def inference(img):
|
|
52 |
pred_class_probs = [prediction[0][i.item()].item() * 100 for i in pred_classes[0]]
|
53 |
res = "Top 5 predicted labels:\n"
|
54 |
for name, prob in zip(pred_class_names, pred_class_probs):
|
55 |
-
res += f"
|
56 |
return res
|
57 |
|
58 |
inputs = gr.inputs.Image(type='pil')
|
|
|
52 |
pred_class_probs = [prediction[0][i.item()].item() * 100 for i in pred_classes[0]]
|
53 |
res = "Top 5 predicted labels:\n"
|
54 |
for name, prob in zip(pred_class_names, pred_class_probs):
|
55 |
+
res += f"[{prob:2.2f}%]\t{name}\n"
|
56 |
return res
|
57 |
|
58 |
inputs = gr.inputs.Image(type='pil')
|