Spaces:
Sleeping
Sleeping
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) | |