bauckluc commited on
Commit
a81a1e2
·
verified ·
1 Parent(s): 3b1de78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -37,9 +37,9 @@ def predict_bmwX(image):
37
  prediction_dict = {class_names[i]: np.round(float(prediction[0][i]), 2) for i in range(len(class_names))}
38
 
39
  # Sort the dictionary by value in descending order and get the top 3 classes
40
- top_3 = dict(sorted(prediction_dict.items(), key=lambda item: item[1], reverse=True)[:3])
41
 
42
- return top_3
43
 
44
 
45
  input_image = gr.Image()
 
37
  prediction_dict = {class_names[i]: np.round(float(prediction[0][i]), 2) for i in range(len(class_names))}
38
 
39
  # Sort the dictionary by value in descending order and get the top 3 classes
40
+ sorted_predictions = dict(sorted(prediction_dict.items(), key=lambda item: item[1], reverse=True))
41
 
42
+ return sorted_predictions
43
 
44
 
45
  input_image = gr.Image()