Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,12 @@ from FootDetection import FootDetection
|
|
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=
|
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()
|
|
|
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, threshold):
|
8 |
+
results = foot_detection.detect(img, threshold=threshold)
|
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'), gr.Slider(label='Threshold', minimum=0.0, maximum=1.0, value=0.3)],
|
14 |
outputs=gr.Image(label='Result', type='pil'))
|
15 |
demo.launch()
|