hb-setosys commited on
Commit
9aea5dd
·
verified ·
1 Parent(s): b42a3d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -28,9 +28,9 @@ def predict_image(image):
28
  predictions = model.predict(image_array)
29
  decoded_predictions = decode_predictions(predictions, top=3)[0]
30
 
31
- # Format predictions as a dictionary
32
- results = {label: f"{confidence * 100:.2f}%" for _, label, confidence in decoded_predictions}
33
- return results
34
 
35
  except Exception as e:
36
  return {"Error": str(e)}
 
28
  predictions = model.predict(image_array)
29
  decoded_predictions = decode_predictions(predictions, top=3)[0]
30
 
31
+ # Format predictions as a list of tuples (label, confidence)
32
+ results = [(label, float(confidence)) for _, label, confidence in decoded_predictions]
33
+ return dict(results)
34
 
35
  except Exception as e:
36
  return {"Error": str(e)}