Docker2TestVALOD / yolov10streamlit.py
datnguyentien204's picture
Upload 8 files
253e609 verified
raw
history blame
623 Bytes
from ultralytics import YOLO
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import streamlit as st
model=YOLO('yolov10n.pt')
st.title("YOLOv10 Object Detection")
uploaded_file=st.file_uploader("Chon mot tep anh? ", type=['jpg','jpeg','png'])
if uploaded_file is not None:
image = Image.open(uploaded_file)
st.image(image, caption="Anh dau vao", use_column_width=True)
if st.button("Predict"):
results=model.predict(source=np.array(image))
result_images = results[0].plot()
st.image(result_images, caption="Anh dau ra", use_column_width=True)