File size: 588 Bytes
5c6194d
7e49696
5c6194d
e28f634
7e49696
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import streamlit as st
from ultralytics import YOLO

model = YOLO("./models/yolov8-best.pt")
classNames = ["license-plate", "vehicle"]

st.title("Number Plate and Vehicle Detection using YOLOv8")

st.write("This is a web app to detect number plates and vehicles in images using YOLOv8.")

image = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"])

if image is not None:
    st.image(image, caption="Uploaded Image", use_column_width=True)
    img = image.read()
    results = model.predict(image, conf=0.5)
    json_results = results[0].tojson()
    st.write(json_results)