DeltaSatellite1 commited on
Commit
e837f49
·
verified ·
1 Parent(s): c875d9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  import PIL.Image as Image
3
 
4
- from ultralytics import ASSETS, YOLO
5
 
6
  model = None
7
 
@@ -25,20 +25,18 @@ def predict_image(img, conf_threshold, iou_threshold, model_name):
25
  return im
26
 
27
 
28
- iface = gr.Interface(
29
  fn=predict_image,
30
  inputs=[
31
  gr.Image(type="pil", label="Upload Image"),
32
- gr.Slider(minimum=0, maximum=1, value=0.25, label="Confidence threshold"),
33
- gr.Slider(minimum=0, maximum=1, value=0.45, label="IoU threshold"),
34
- gr.Radio(choices=["best", "yolo11s", "yolo11n-seg", "yolo11s-seg", "yolo11n-pose", "yolo11s-pose"], label="Model Name", value="yolo11n"),
 
 
35
  ],
36
  outputs=gr.Image(type="pil", label="Result"),
37
  title="Ultralytics Gradio Application 🚀",
38
  description="Upload images for inference. The Ultralytics YOLO11n model is used by default.",
39
- examples=[
40
- [ASSETS / "bus.jpg", 0.25, 0.45, "yolo11n.pt"],
41
- [ASSETS / "zidane.jpg", 0.25, 0.45, "yolo11n.pt"],
42
- ],
43
  )
44
- iface.launch(share=True)
 
1
  import gradio as gr
2
  import PIL.Image as Image
3
 
4
+ from ultralytics import YOLO
5
 
6
  model = None
7
 
 
25
  return im
26
 
27
 
28
+ demo = gr.Interface(
29
  fn=predict_image,
30
  inputs=[
31
  gr.Image(type="pil", label="Upload Image"),
32
+ # gr.Slider(minimum=0, maximum=1, value=0.25, label="Confidence threshold"),
33
+ 0.24,
34
+ 0.45,
35
+ # gr.Slider(minimum=0, maximum=1, value=0.45, label="IoU threshold"),
36
+ gr.Radio(choices=["best", "yolo11s", "yolo11n"], label="Model Name", value="best"),
37
  ],
38
  outputs=gr.Image(type="pil", label="Result"),
39
  title="Ultralytics Gradio Application 🚀",
40
  description="Upload images for inference. The Ultralytics YOLO11n model is used by default.",
 
 
 
 
41
  )
42
+ demo.launch(share=True)