Sa-m commited on
Commit
3062159
1 Parent(s): 47a795d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -43,8 +43,9 @@ 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 = {labels[i]: float(prediction[i]) for i in range(NUM_CLASSES)}
47
- return str(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
+ result = [f"{label}: {prediction:.2f}" for label, prediction in zip(labels, prediction)]
47
+ return ", ".join(result)
48
+
49
 
50
 
51