Update app.py
Browse files
app.py
CHANGED
|
@@ -3,10 +3,10 @@ import torch
|
|
| 3 |
from ultralyticsplus import YOLO, render_result
|
| 4 |
|
| 5 |
|
| 6 |
-
def yoloV9_func(image: gr.
|
| 7 |
-
image_size:
|
| 8 |
-
conf_threshold:
|
| 9 |
-
iou_threshold:
|
| 10 |
"""This function performs YOLOv9 object detection on the given image.
|
| 11 |
|
| 12 |
Args:
|
|
@@ -37,17 +37,17 @@ def yoloV9_func(image: gr.inputs.Image = None,
|
|
| 37 |
|
| 38 |
|
| 39 |
inputs = [
|
| 40 |
-
gr.
|
| 41 |
-
gr.
|
| 42 |
step=32, label="Image Size"),
|
| 43 |
-
gr.
|
| 44 |
step=0.05, label="Confidence Threshold"),
|
| 45 |
-
gr.
|
| 46 |
step=0.05, label="IOU Threshold"),
|
| 47 |
]
|
| 48 |
|
| 49 |
|
| 50 |
-
outputs = gr.
|
| 51 |
|
| 52 |
title = "CUSTOM yolov9 model for room cleanliness"
|
| 53 |
|
|
|
|
| 3 |
from ultralyticsplus import YOLO, render_result
|
| 4 |
|
| 5 |
|
| 6 |
+
def yoloV9_func(image: gr.Image = None,
|
| 7 |
+
image_size: int = 640,
|
| 8 |
+
conf_threshold: float = 0.4,
|
| 9 |
+
iou_threshold: float = 0.50):
|
| 10 |
"""This function performs YOLOv9 object detection on the given image.
|
| 11 |
|
| 12 |
Args:
|
|
|
|
| 37 |
|
| 38 |
|
| 39 |
inputs = [
|
| 40 |
+
gr.Image(type="filepath", label="Input Image"),
|
| 41 |
+
gr.Slider(minimum=320, maximum=1280, default=640,
|
| 42 |
step=32, label="Image Size"),
|
| 43 |
+
gr.Slider(minimum=0.0, maximum=1.0, default=0.25,
|
| 44 |
step=0.05, label="Confidence Threshold"),
|
| 45 |
+
gr.Slider(minimum=0.0, maximum=1.0, default=0.45,
|
| 46 |
step=0.05, label="IOU Threshold"),
|
| 47 |
]
|
| 48 |
|
| 49 |
|
| 50 |
+
outputs = gr.Image(type="filepath", label="Output Image")
|
| 51 |
|
| 52 |
title = "CUSTOM yolov9 model for room cleanliness"
|
| 53 |
|