import gradio as gr from ultralytics import YOLO import cv2 model = YOLO("last.pt") def predict(image): results = model(image)[0] return results.plot() gr.Interface( fn=predict, inputs=gr.Image(type="numpy"), outputs=gr.Image(type="numpy"), title="Vehicle Detection App" ).launch()