Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from FootDetection import FootDetection
|
3 |
+
|
4 |
+
# Initialize model (first run will auto-download weights)
|
5 |
+
foot_detection = FootDetection("cpu") # "cuda" for GPU or "mps" for App
|
6 |
+
|
7 |
+
def detect(img):
|
8 |
+
results = foot_detection.detect(img, threshold=0.1)
|
9 |
+
img_with_boxes = foot_detection.draw_boxes(img)
|
10 |
+
return img_with_boxes
|
11 |
+
|
12 |
+
demo = gr.Interface(fn=detect,
|
13 |
+
inputs=gr.Image(label='Input', type='pil'),
|
14 |
+
outputs=gr.Image(label='Result', type='pil'))
|
15 |
+
demo.launch()
|