Spaces:
Runtime error
Runtime error
Commit
·
cd38c64
1
Parent(s):
5618862
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
from ultralyticsplus import YOLO, render_result
|
4 |
|
5 |
|
@@ -40,18 +40,20 @@ def yoloV8_func(image: gr.Image = None,
|
|
40 |
return render
|
41 |
|
42 |
|
|
|
43 |
inputs = [
|
44 |
gr.Image(type="filepath", label="Input Image"),
|
45 |
-
gr.Slider(minimum=320, maximum=1280,
|
46 |
-
|
47 |
-
gr.Slider(minimum=0.0, maximum=1.0,
|
48 |
-
|
49 |
-
gr.Slider(minimum=0.0, maximum=1.0,
|
50 |
-
|
51 |
]
|
52 |
|
53 |
|
54 |
-
|
|
|
55 |
|
56 |
|
57 |
title = "YOLOv8 101: Custom Object Detection on Construction Workers"
|
@@ -64,7 +66,7 @@ examples = [['img1.jpg', 640, 0.5, 0.7],
|
|
64 |
yolo_app = gr.Interface(
|
65 |
fn=yoloV8_func,
|
66 |
inputs=inputs,
|
67 |
-
outputs=
|
68 |
title=title,
|
69 |
examples=examples,
|
70 |
cache_examples=True,
|
|
|
1 |
import gradio as gr
|
2 |
+
|
3 |
from ultralyticsplus import YOLO, render_result
|
4 |
|
5 |
|
|
|
40 |
return render
|
41 |
|
42 |
|
43 |
+
|
44 |
inputs = [
|
45 |
gr.Image(type="filepath", label="Input Image"),
|
46 |
+
gr.Slider(minimum=320, maximum=1280, value=640, # Changed 'default' to 'value'
|
47 |
+
step=32, label="Image Size"),
|
48 |
+
gr.Slider(minimum=0.0, maximum=1.0, value=0.25, # Changed 'default' to 'value'
|
49 |
+
step=0.05, label="Confidence Threshold"),
|
50 |
+
gr.Slider(minimum=0.0, maximum=1.0, value=0.45, # Changed 'default' to 'value'
|
51 |
+
step=0.05, label="IOU Threshold"),
|
52 |
]
|
53 |
|
54 |
|
55 |
+
|
56 |
+
output_image = gr.Image(label="Output Image")
|
57 |
|
58 |
|
59 |
title = "YOLOv8 101: Custom Object Detection on Construction Workers"
|
|
|
66 |
yolo_app = gr.Interface(
|
67 |
fn=yoloV8_func,
|
68 |
inputs=inputs,
|
69 |
+
outputs=output_image,
|
70 |
title=title,
|
71 |
examples=examples,
|
72 |
cache_examples=True,
|