update description and default imgsz
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ if not os.path.exists(MODEL_PATH):
|
|
| 14 |
# Load YOLOv12x model
|
| 15 |
model = YOLO(MODEL_PATH)
|
| 16 |
|
| 17 |
-
def run_detection(input_image, conf_threshold=0.60, iou_threshold=0.45, imgsz=
|
| 18 |
"""
|
| 19 |
Runs YOLOv12x inference on an image.
|
| 20 |
Returns annotated image result.
|
|
@@ -40,12 +40,12 @@ demo = gr.Interface(
|
|
| 40 |
gr.Image(type="numpy", label="Input Image"),
|
| 41 |
gr.Slider(0, 1, value=0.60, step=0.01, label="Confidence Threshold"),
|
| 42 |
gr.Slider(0, 1, value=0.45, step=0.01, label="IoU Threshold"),
|
| 43 |
-
gr.Slider(320, 1280, value=
|
| 44 |
],
|
| 45 |
outputs=gr.Image(type="numpy", label="Detected Output"),
|
| 46 |
title="Community Fish Detector (YOLOv12x)",
|
| 47 |
description=(
|
| 48 |
-
f"Upload an image
|
| 49 |
),
|
| 50 |
flagging_mode="never",
|
| 51 |
)
|
|
|
|
| 14 |
# Load YOLOv12x model
|
| 15 |
model = YOLO(MODEL_PATH)
|
| 16 |
|
| 17 |
+
def run_detection(input_image, conf_threshold: float = 0.60, iou_threshold: float = 0.45, imgsz: int = 1024):
|
| 18 |
"""
|
| 19 |
Runs YOLOv12x inference on an image.
|
| 20 |
Returns annotated image result.
|
|
|
|
| 40 |
gr.Image(type="numpy", label="Input Image"),
|
| 41 |
gr.Slider(0, 1, value=0.60, step=0.01, label="Confidence Threshold"),
|
| 42 |
gr.Slider(0, 1, value=0.45, step=0.01, label="IoU Threshold"),
|
| 43 |
+
gr.Slider(320, 1280, value=1024, step=32, label="Image Size"),
|
| 44 |
],
|
| 45 |
outputs=gr.Image(type="numpy", label="Detected Output"),
|
| 46 |
title="Community Fish Detector (YOLOv12x)",
|
| 47 |
description=(
|
| 48 |
+
f"Upload an image to detect fish using the [Community Fish Detector]({REPO_URL})."
|
| 49 |
),
|
| 50 |
flagging_mode="never",
|
| 51 |
)
|