Spaces:
Running
Running
Download app.py from UEmmanuel5/profsam-fire-demo: direct link, hf CLI and curl.
- Browser
- Download file 458 Bytes
-
https://huggingface.co/spaces/UEmmanuel5/profsam-fire-demo/resolve/main/app.py
- Command line
-
hf download hf://spaces/UEmmanuel5/profsam-fire-demo/app.py
-
curl -L -o app.py https://huggingface.co/spaces/UEmmanuel5/profsam-fire-demo/resolve/main/app.py
458 Bytes
| import gradio as gr | |
| from ultralytics import YOLO | |
| from huggingface_hub import hf_hub_download | |
| REPO_ID = "UEmmanuel5/ProFSAM-Fire-Detector" | |
| CKPT = hf_hub_download(REPO_ID, "Fire_best.pt") | |
| model = YOLO(CKPT) | |
| def detect(img): | |
| pred = model.predict(img, imgsz=640, conf=0.3) | |
| return pred[0].plot() | |
| gr.Interface(fn=detect, | |
| inputs=gr.Image(type="pil"), | |
| outputs=gr.Image(), | |
| title="Fire Detection (YOLOv11n)").launch() | |