DeltaSatellite1 commited on
Commit
bc5c911
·
verified ·
1 Parent(s): 84ca6fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -14
app.py CHANGED
@@ -9,20 +9,14 @@ model = None
9
  def predict_image(img):
10
  """Predicts objects in an image using a YOLOv8 model with adjustable confidence and IOU thresholds."""
11
  model = YOLO("best")
12
- results = model.predict(
13
- source=img,
14
- conf=0.25,
15
- iou=0.45,
16
- show_labels=True,
17
- show_conf=True,
18
- imgsz=640,
19
- )
20
-
21
- for r in results:
22
- im_array = r.plot()
23
- im = Image.fromarray(im_array[..., ::-1])
24
-
25
- return im
26
 
27
 
28
  demo = gr.Interface(
 
9
  def predict_image(img):
10
  """Predicts objects in an image using a YOLOv8 model with adjustable confidence and IOU thresholds."""
11
  model = YOLO("best")
12
+ model.predict(source=img, save=True)
13
+ results = model(img)
14
+
15
+ # for r in results:
16
+ # im_array = r.plot()
17
+ # im = Image.fromarray(im_array[..., ::-1])
18
+
19
+ return results[0]
 
 
 
 
 
 
20
 
21
 
22
  demo = gr.Interface(