tonyassi commited on
Commit
84ce883
·
verified ·
1 Parent(s): 527ac9a

Update app.py

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