This repository is an extensive open-source project showcasing the seamless integration of object detection and tracking using YOLOv8 (object detection algorithm), along with Streamlit (a popular Python web application framework for creating interactive web apps). The project offers a user-friendly and customizable interface designed to detect and track objects in real-time video streams from sources such as RTSP, UDP, and YouTube URLs, as well as static videos and images.
For a deeper dive into the implementation, check out my three-part blog series on Medium, where I detail the step-by-step process of creating this web application.
Thank you team Streamlit for the community support for the cloud upload.
This app is up and running on Streamlit cloud server!!! You can check the demo of this web application on this link yolov8-streamlit-detection-tracking-webapp
Note: In the demo, Due to non-availability of GPUs, you may encounter slow video inferencing.
https://github.com/user-attachments/assets/85df351a-371c-47e0-91a0-a816cf468d19.mov
Python 3.6+ YOLOv8 Streamlit
pip install ultralytics streamlit pytube
cd yolov8-streamlit-detection-tracking
weights
, videos
, and images
directories inside the project.weights
directory in the same project.streamlit run app.py
One the model config is done, select a source.
Image
).videos
in the same directorysettings.py
edit the following lines.# video
VIDEO_DIR = ROOT / 'videos' # After creating the videos folder
# Suppose you have four videos inside videos folder
# Edit the name of video_1, 2, 3, 4 (with the names of your video files)
VIDEO_1_PATH = VIDEO_DIR / 'video_1.mp4'
VIDEO_2_PATH = VIDEO_DIR / 'video_2.mp4'
VIDEO_3_PATH = VIDEO_DIR / 'video_3.mp4'
VIDEO_4_PATH = VIDEO_DIR / 'video_4.mp4'
# Edit the same names here also.
VIDEOS_DICT = {
'video_1': VIDEO_1_PATH,
'video_2': VIDEO_2_PATH,
'video_3': VIDEO_3_PATH,
'video_4': VIDEO_4_PATH,
}
# Your videos will start appearing inside streamlit webapp 'Choose a video'.
Detect Video Objects
button and the selected task (detection/segmentation) will start on the selected video.Detect Objects
buttonThis app uses YOLOv8 for object detection algorithm and Streamlit library for the user interface.
This project is intended as a learning exercise and demonstration of integrating various technologies, including:
Please note that this application is not designed or tested for production use. It serves as an educational resource and a showcase of technology integration rather than a production-ready web application.
Contributors and users are welcome to explore, learn from, and build upon this project for educational purposes.