Sa-m commited on
Commit
252f8ec
1 Parent(s): 3062159

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -43,7 +43,7 @@ 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 zip(labels, prediction)]
47
  return ", ".join(result)
48
 
49
 
 
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.tolist(), np.round(prediction, 2).tolist())]
47
  return ", ".join(result)
48
 
49