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()