paoyingheng commited on
Commit
1e74cc3
1 Parent(s): adb423a
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -16,9 +16,7 @@ def para_func(image: gr.Image = None, image_size: gr.Slider = 640, conf_threshol
16
  box = results[0].boxes
17
  print("Object type:", box.cls)
18
  print("Coordinates:", box.xyxy)
19
- probability_percentage = box.conf.item() * 100 # Converts the tensor to a float
20
- print("Probability:", f'{probability_percentage:.1f}%')
21
-
22
 
23
  # Render the output image with bounding boxes around detected objects
24
  render = render_result(model=model, image=image, result=results[0])
 
16
  box = results[0].boxes
17
  print("Object type:", box.cls)
18
  print("Coordinates:", box.xyxy)
19
+ print("Probability:", box.conf)
 
 
20
 
21
  # Render the output image with bounding boxes around detected objects
22
  render = render_result(model=model, image=image, result=results[0])