Download app.py from Emiloz12/Mod5Gen24: direct link, hf CLI and curl.
- Browser
- Download file 474 Bytes
-
https://huggingface.co/spaces/Emiloz12/Mod5Gen24/resolve/main/app.py
- Command line
-
hf download hf://spaces/Emiloz12/Mod5Gen24/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Emiloz12/Mod5Gen24/resolve/main/app.py
474 Bytes
| import cv2 | |
| import numpy as np | |
| import gradio as gr | |
| from ultralytics import YOLO | |
| def predict(path:str): | |
| model = YOLO("yolo11s.yaml") | |
| model = YOLO("best.pt") | |
| imagen = cv2.imread(path) | |
| results = model.predict(source=path) | |
| for r in results: | |
| return r.plot() | |
| gr.Interface(fn=predict, | |
| inputs=gr.components.Image(type="filepath", label="Input"), | |
| outputs=gr.components.Image(type="numpy", label="Output")).launch(debug=False) |