yolov8 / app.py
NotShrirang's picture
frat: add yolov8 detection code
e28f634
raw
history blame
588 Bytes
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)