File size: 442 Bytes
85006c3
6ca3b52
85006c3
6ca3b52
 
8fe8be0
718657d
 
 
ac9eb6d
718657d
 
a9d8847
8fe8be0
de8582c
718657d
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
from ultralytics import YOLO

def run(source):
    global model
    res = model(source, conf=.5, iou=.5)
    res_plotted = res[0].plot()
    return res_plotted
    
model = YOLO("yolov8n-nckh2023.pt") # Select YOLO model

gr.Interface(
    run,
    inputs=gr.Image(label="Upload image", type="filepath"),
    outputs=gr.Image(label="Your result"),
    title="Motorcyclist, helmet, and license plate detection",
).launch()