Update app.py
Browse files
app.py
CHANGED
@@ -15,9 +15,9 @@ import PIL
|
|
15 |
model_base = 'onnx_models'
|
16 |
|
17 |
def inference(
|
18 |
-
im:gr.
|
19 |
-
model_path:gr.
|
20 |
-
conf_thr:gr.
|
21 |
):
|
22 |
#model = Yolov8DetectionModel(model_path=f'{model_base}/{model_path}/{model_path}.pt',
|
23 |
model = Yolov8onnxDetectionModel(model_path=f'{model_base}/{model_path}/{model_path.lower()}.onnx',
|
@@ -43,7 +43,7 @@ def inference(
|
|
43 |
|
44 |
inputs = [
|
45 |
gr.Image(type='filepath', label='Input'),
|
46 |
-
gr.
|
47 |
'YOLOv8n',
|
48 |
'YOLOv8s',
|
49 |
'YOLOv8m',
|
@@ -51,7 +51,7 @@ inputs = [
|
|
51 |
'YOLOv8x'
|
52 |
],
|
53 |
value='YOLOv8n', label='Model'),
|
54 |
-
gr.
|
55 |
]
|
56 |
|
57 |
outputs = [
|
|
|
15 |
model_base = 'onnx_models'
|
16 |
|
17 |
def inference(
|
18 |
+
im:gr.Image=None,
|
19 |
+
model_path:gr.Dropdown='YOLOv8n',
|
20 |
+
conf_thr:gr.Slider=0.25
|
21 |
):
|
22 |
#model = Yolov8DetectionModel(model_path=f'{model_base}/{model_path}/{model_path}.pt',
|
23 |
model = Yolov8onnxDetectionModel(model_path=f'{model_base}/{model_path}/{model_path.lower()}.onnx',
|
|
|
43 |
|
44 |
inputs = [
|
45 |
gr.Image(type='filepath', label='Input'),
|
46 |
+
gr.Dropdown([
|
47 |
'YOLOv8n',
|
48 |
'YOLOv8s',
|
49 |
'YOLOv8m',
|
|
|
51 |
'YOLOv8x'
|
52 |
],
|
53 |
value='YOLOv8n', label='Model'),
|
54 |
+
gr.Slider(minimum=0.0, maximum=1.0, value=0.25, step=0.05, label='Confidence Threshold'),
|
55 |
]
|
56 |
|
57 |
outputs = [
|