pothole-yolo / app.py
utkarsh-23's picture
Upload app.py with huggingface_hub
2ef9854 verified
raw
history blame
414 Bytes
import gradio as gr
from ultralytics import YOLO
# Load model (weights must be in repo)
model = YOLO("best.pt")
def predict(image):
results = model.predict(image, conf=0.25)
return results[0].plot()
iface = gr.Interface(
fn=predict,
inputs=gr.Image(type="filepath"),
outputs=gr.Image(type="numpy"),
title="Pothole Detection with YOLOv8"
)
if __name__ == "__main__":
iface.launch()