File size: 309 Bytes
1ff8ae9
484f522
1ff8ae9
 
484f522
1ff8ae9
484f522
 
 
1ff8ae9
 
484f522
1ff8ae9
 
484f522
1ff8ae9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()