Dricz commited on
Commit
e559f1e
1 Parent(s): b6d54f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -26,22 +26,16 @@ def yoloV8_func(image: gr.Image = None,
26
  conf_threshold: gr.Slider = 0.4,
27
  iou_threshold: gr.Slider = 0.50):
28
 
29
-
30
-
31
-
32
- # Perform object detection on the input image using the YOLOv8 model
33
  results = model.predict(image,
34
  conf=conf_threshold,
35
  iou=iou_threshold,
36
  imgsz=image_size)
37
 
38
- # Print the detected objects' information (class, coordinates, and probability)
39
  box = results[0].boxes
40
  print("Object type:", box.cls)
41
  print("Coordinates:", box.xyxy)
42
  print("Probability:", box.conf)
43
 
44
- # Render the output image with bounding boxes around detected objects
45
  render = render_result(model=model, image=image, result=results[0], rect_th = 4, text_th = 4)
46
  return render
47
 
@@ -80,5 +74,5 @@ yolo_app = gr.Interface(
80
  yolo_app.launch(debug=True, share=True)
81
 
82
 
83
- iface = gr.Interface(fn=response, inputs="image", outputs="image")
84
- iface.launch()
 
26
  conf_threshold: gr.Slider = 0.4,
27
  iou_threshold: gr.Slider = 0.50):
28
 
 
 
 
 
29
  results = model.predict(image,
30
  conf=conf_threshold,
31
  iou=iou_threshold,
32
  imgsz=image_size)
33
 
 
34
  box = results[0].boxes
35
  print("Object type:", box.cls)
36
  print("Coordinates:", box.xyxy)
37
  print("Probability:", box.conf)
38
 
 
39
  render = render_result(model=model, image=image, result=results[0], rect_th = 4, text_th = 4)
40
  return render
41
 
 
74
  yolo_app.launch(debug=True, share=True)
75
 
76
 
77
+ # iface = gr.Interface(fn=response, inputs="image", outputs="image")
78
+ # iface.launch()