NCKH_2023 / app.py
Lasion's picture
Update
8fe8be0
raw
history blame
442 Bytes
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()