Spaces:
Sleeping
Sleeping
Commit
·
b626944
1
Parent(s):
b6a2211
lean
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
|
5 |
model = None
|
6 |
|
7 |
# ./darknet detect cfg/yolov2.cfg yolov2.weights ~/OneDrive\ -\ One\ Thousand\ GmbH/3.jpg
|
8 |
def predict_image(img, conf_threshold, iou_threshold, model_name):
|
9 |
"""Predicts objects in an image using a YOLOv8 model with adjustable confidence and IOU thresholds."""
|
10 |
-
|
11 |
|
12 |
|
13 |
iface = gr.Interface(
|
@@ -21,5 +21,9 @@ iface = gr.Interface(
|
|
21 |
outputs=gr.Image(type="pil", label="Result"),
|
22 |
title="Ultralytics Gradio Application 🚀",
|
23 |
description="Upload images for inference. The Ultralytics YOLO11n model is used by default.",
|
|
|
|
|
|
|
|
|
24 |
)
|
25 |
iface.launch(share=True)
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
from ultralytics import ASSETS
|
4 |
|
5 |
model = None
|
6 |
|
7 |
# ./darknet detect cfg/yolov2.cfg yolov2.weights ~/OneDrive\ -\ One\ Thousand\ GmbH/3.jpg
|
8 |
def predict_image(img, conf_threshold, iou_threshold, model_name):
|
9 |
"""Predicts objects in an image using a YOLOv8 model with adjustable confidence and IOU thresholds."""
|
10 |
+
return img
|
11 |
|
12 |
|
13 |
iface = gr.Interface(
|
|
|
21 |
outputs=gr.Image(type="pil", label="Result"),
|
22 |
title="Ultralytics Gradio Application 🚀",
|
23 |
description="Upload images for inference. The Ultralytics YOLO11n model is used by default.",
|
24 |
+
examples=[
|
25 |
+
[ASSETS / "bus.jpg", 0.25, 0.45, "yolo11n.pt"],
|
26 |
+
[ASSETS / "zidane.jpg", 0.25, 0.45, "yolo11n.pt"],
|
27 |
+
],
|
28 |
)
|
29 |
iface.launch(share=True)
|