Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -39,11 +39,11 @@ model = YOLO(current_model_id)
|
|
39 |
|
40 |
###################################################
|
41 |
def yolov8_img_inference(
|
42 |
-
image
|
43 |
-
model_path
|
44 |
-
image_size
|
45 |
-
conf_threshold
|
46 |
-
iou_threshold
|
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.
|
145 |
-
gr.
|
146 |
-
gr.
|
147 |
-
gr.
|
148 |
-
gr.
|
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,
|