Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,10 +46,10 @@ def classify_image(inp):
|
|
| 46 |
label_order = ["Burger King", "KFC", "McDonalds", "Other", "Starbucks", "Subway"]
|
| 47 |
|
| 48 |
# Assuming prediction is a dictionary with label keys
|
| 49 |
-
result = [f"{label}: {prediction[label]:.2f}" for label in label_order]
|
| 50 |
-
return ", ".join(result)
|
| 51 |
-
# result = [f"{label}: {prediction:.2f}" for label, prediction in labels.items()]
|
| 52 |
# return ", ".join(result)
|
|
|
|
|
|
|
| 53 |
|
| 54 |
|
| 55 |
|
|
|
|
| 46 |
label_order = ["Burger King", "KFC", "McDonalds", "Other", "Starbucks", "Subway"]
|
| 47 |
|
| 48 |
# Assuming prediction is a dictionary with label keys
|
| 49 |
+
# result = [f"{label}: {prediction[label]:.2f}" for label in label_order]
|
|
|
|
|
|
|
| 50 |
# return ", ".join(result)
|
| 51 |
+
result = [f"{label}: {prediction[y]:.2f}" for label, y in labels.items()]
|
| 52 |
+
return ", ".join(result)
|
| 53 |
|
| 54 |
|
| 55 |
|