gpbhupinder commited on
Commit
d4c4b8a
1 Parent(s): c15dfd3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -8
app.py CHANGED
@@ -17,14 +17,7 @@ def predict_image(img):
17
  im_array = r.plot()
18
  im = Image.fromarray(im_array[..., ::-1])
19
 
20
- # Extract class names and confidences
21
- class_names = [model.names[int(cls)] for cls in r.boxes.cls]
22
- confidences = r.boxes.conf.tolist()
23
-
24
- # Create a formatted string of results
25
- result_text = "\n".join([f"{name}: {conf:.2f}" for name, conf in zip(class_names, confidences)])
26
-
27
- return im, result_text
28
 
29
  iface = gr.Interface(
30
  fn=predict_image,
 
17
  im_array = r.plot()
18
  im = Image.fromarray(im_array[..., ::-1])
19
 
20
+ return im
 
 
 
 
 
 
 
21
 
22
  iface = gr.Interface(
23
  fn=predict_image,