Spaces:
Runtime error
Runtime error
nehulagrawal
commited on
Commit
β’
e56e1a2
1
Parent(s):
f6f3560
Update app.py
Browse files
app.py
CHANGED
@@ -5,11 +5,11 @@ from sahi.utils.cv import visualize_object_predictions, read_image
|
|
5 |
from ultralyticsplus import YOLO, render_result
|
6 |
|
7 |
def yolov8_inference(
|
8 |
-
image: gr.
|
9 |
-
model_path: gr.
|
10 |
-
image_size: gr.
|
11 |
-
conf_threshold: gr.
|
12 |
-
iou_threshold: gr.
|
13 |
):
|
14 |
"""
|
15 |
YOLOv8 inference function
|
@@ -35,20 +35,19 @@ def yolov8_inference(
|
|
35 |
|
36 |
|
37 |
inputs = [
|
38 |
-
gr.
|
39 |
-
gr.
|
40 |
-
|
41 |
-
gr.
|
42 |
-
gr.
|
43 |
-
gr.
|
44 |
]
|
45 |
|
46 |
-
outputs = gr.
|
47 |
title = "ThermalSense: Object Detection in Thermal Images"
|
48 |
|
49 |
description ="""
|
50 |
π₯ Unveiling ThermalFoduu: Spot Objects with Thermal Vision! ππΈ Lost your keys in the dark? ποΈπ ThermalFoduu's got you covered! Powered by Foduu AI, our app effortlessly detects objects in thermal images. No more blurry blobs β just pinpoint accuracy! π¦
π―
|
51 |
-
|
52 |
Love the thermal world? Give us a thumbs up! π Questions or suggestions? Contact us at info@foduu. Let's decode the thermal universe together! π§π‘οΈ
|
53 |
"""
|
54 |
examples = [['samples/1.jpeg', 'foduucom/thermal-image-object-detection', 640, 0.25, 0.45], ['samples/2.jpg', 'foduucom/thermal-image-object-detection', 640, 0.25, 0.45]]
|
@@ -62,4 +61,4 @@ demo_app = gr.Interface(
|
|
62 |
cache_examples=True,
|
63 |
theme='huggingface',
|
64 |
)
|
65 |
-
demo_app.launch(debug=True
|
|
|
5 |
from ultralyticsplus import YOLO, render_result
|
6 |
|
7 |
def yolov8_inference(
|
8 |
+
image: gr.Image = None,
|
9 |
+
model_path: gr.Dropdown = None,
|
10 |
+
image_size: gr.Slider = 640,
|
11 |
+
conf_threshold: gr.Slider = 0.25,
|
12 |
+
iou_threshold: gr.Slider = 0.45,
|
13 |
):
|
14 |
"""
|
15 |
YOLOv8 inference function
|
|
|
35 |
|
36 |
|
37 |
inputs = [
|
38 |
+
gr.Image(type="filepath", label="Input Image"),
|
39 |
+
gr.Dropdown(["foduucom/thermal-image-object-detection"],
|
40 |
+
default="foduucom/thermal-image-object-detection", label="Model"),
|
41 |
+
gr.Slider(minimum=320, maximum=1280, default=640, step=32, label="Image Size"),
|
42 |
+
gr.Slider(minimum=0.0, maximum=1.0, default=0.25, step=0.05, label="Confidence Threshold"),
|
43 |
+
gr.Slider(minimum=0.0, maximum=1.0, default=0.45, step=0.05, label="IOU Threshold"),
|
44 |
]
|
45 |
|
46 |
+
outputs = gr.Image(type="filepath", label="Output Image")
|
47 |
title = "ThermalSense: Object Detection in Thermal Images"
|
48 |
|
49 |
description ="""
|
50 |
π₯ Unveiling ThermalFoduu: Spot Objects with Thermal Vision! ππΈ Lost your keys in the dark? ποΈπ ThermalFoduu's got you covered! Powered by Foduu AI, our app effortlessly detects objects in thermal images. No more blurry blobs β just pinpoint accuracy! π¦
π―
|
|
|
51 |
Love the thermal world? Give us a thumbs up! π Questions or suggestions? Contact us at info@foduu. Let's decode the thermal universe together! π§π‘οΈ
|
52 |
"""
|
53 |
examples = [['samples/1.jpeg', 'foduucom/thermal-image-object-detection', 640, 0.25, 0.45], ['samples/2.jpg', 'foduucom/thermal-image-object-detection', 640, 0.25, 0.45]]
|
|
|
61 |
cache_examples=True,
|
62 |
theme='huggingface',
|
63 |
)
|
64 |
+
demo_app.queue().launch(debug=True)
|