UEmmanuel5's picture
Create app.py
1c3aa68 verified
Raw History Blame Contribute Delete
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()