tonyassi commited on
Commit
8c881da
·
verified ·
1 Parent(s): 420e443

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
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()