linhcuem commited on
Commit
345e28e
·
verified ·
1 Parent(s): b36d302

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -39,11 +39,11 @@ model = YOLO(current_model_id)
39
 
40
  ###################################################
41
  def yolov8_img_inference(
42
- image: gr.inputs.Image = None,
43
- model_path: gr.inputs.Dropdown = None,
44
- image_size: gr.inputs.Slider = 640,
45
- conf_threshold: gr.inputs.Slider = 0.25,
46
- iou_threshold: gr.inputs.Slider = 0.45,
47
  ):
48
  # model = YOLO(model_path)
49
  global current_model_id
@@ -141,11 +141,11 @@ title = "Detect Thiên Việt productions"
141
  interface_image = gr.Interface(
142
  fn=yolov8_img_inference,
143
  inputs=[
144
- gr.inputs.Image(type='pil'),
145
- gr.inputs.Dropdown(model_ids, value=model_ids[-1]),
146
- gr.inputs.Slider(minimum=320, maximum=1280, default=640, step=32, label="Image Size"),
147
- gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.25, step=0.05, label="Confidence Threshold"),
148
- gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.45, step=0.05, label="IOU Threshold"),
149
  ],
150
  outputs=[gr.Image(type="pil"),gr.Textbox(show_label=False)],
151
  title=title,
 
39
 
40
  ###################################################
41
  def yolov8_img_inference(
42
+ image = None,
43
+ model_path = None,
44
+ image_size = 640,
45
+ conf_threshold = 0.25,
46
+ iou_threshold = 0.45,
47
  ):
48
  # model = YOLO(model_path)
49
  global current_model_id
 
141
  interface_image = gr.Interface(
142
  fn=yolov8_img_inference,
143
  inputs=[
144
+ gr.Image(type='pil'),
145
+ gr.Dropdown(model_ids, value=model_ids[-1]),
146
+ gr.Slider(minimum=320, maximum=1280, default=640, step=32, label="Image Size"),
147
+ gr.Slider(minimum=0.0, maximum=1.0, default=0.25, step=0.05, label="Confidence Threshold"),
148
+ gr.Slider(minimum=0.0, maximum=1.0, default=0.45, step=0.05, label="IOU Threshold"),
149
  ],
150
  outputs=[gr.Image(type="pil"),gr.Textbox(show_label=False)],
151
  title=title,