foot-detection / app.py
tonyassi's picture
Create app.py
8c881da verified
raw
history blame
523 Bytes
import gradio as gr
from FootDetection import FootDetection
# Initialize model (first run will auto-download weights)
foot_detection = FootDetection("cpu") # "cuda" for GPU or "mps" for App
def detect(img):
results = foot_detection.detect(img, threshold=0.1)
img_with_boxes = foot_detection.draw_boxes(img)
return img_with_boxes
demo = gr.Interface(fn=detect,
inputs=gr.Image(label='Input', type='pil'),
outputs=gr.Image(label='Result', type='pil'))
demo.launch()