Sa-m commited on
Commit
e119c02
1 Parent(s): e015e39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -43,8 +43,13 @@ def classify_image(inp):
43
  # result[label] = float(predicted_class_indices[i])
44
  # except KeyError:
45
  # print(f"KeyError: Label not found for index {predicted_class_indices[i]}")
46
- result = [f"{label}: {prediction:.2f}" for label, prediction in labels.items()]
 
 
 
47
  return ", ".join(result)
 
 
48
 
49
 
50
 
 
43
  # result[label] = float(predicted_class_indices[i])
44
  # except KeyError:
45
  # print(f"KeyError: Label not found for index {predicted_class_indices[i]}")
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