Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rampal-punia/yolov8-streamlit-detection-tracking
Object detection and tracking algorithm implemented for Real-Time video streams and static images.
https://github.com/rampal-punia/yolov8-streamlit-detection-tracking
machine-learning ml object-detection object-tracker streamlit streamlit-application tracking-algorithm tracking-by-detection yolo yolov8
Last synced: 4 days ago
JSON representation
Object detection and tracking algorithm implemented for Real-Time video streams and static images.
- Host: GitHub
- URL: https://github.com/rampal-punia/yolov8-streamlit-detection-tracking
- Owner: rampal-punia
- Created: 2023-03-18T12:55:59.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-18T13:09:24.000Z (6 months ago)
- Last Synced: 2025-01-19T08:03:06.833Z (11 days ago)
- Topics: machine-learning, ml, object-detection, object-tracker, streamlit, streamlit-application, tracking-algorithm, tracking-by-detection, yolo, yolov8
- Language: Python
- Homepage: https://codingmantras-yolov8-streamlit-detection-tracking-app-njcqjg.streamlit.app/
- Size: 63.4 MB
- Stars: 317
- Watchers: 6
- Forks: 135
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-yolo-object-detection - rampal-punia/yolov8-streamlit-detection-tracking - punia/yolov8-streamlit-detection-tracking?style=social"/> : Object detection and tracking algorithm implemented for Real-Time video streams and static images. (Applications)
- awesome-yolo-object-detection - rampal-punia/yolov8-streamlit-detection-tracking - punia/yolov8-streamlit-detection-tracking?style=social"/> : Object detection and tracking algorithm implemented for Real-Time video streams and static images. (Applications)
README
# Real-time Object Detection and Tracking with YOLOv8 & Streamlit
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.
## Explore Implementation Details on Medium (3 parts blog series)
For a deeper dive into the implementation, check out my three-part blog series on [Medium](https://medium.com/@mycodingmantras), where I detail the [step-by-step process of creating this web application](https://medium.com/@mycodingmantras/building-a-real-time-object-detection-and-tracking-app-with-yolov8-and-streamlit-part-1-30c56f5eb956).## WebApp Demo on Streamlit Server
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](https://yolov8-object-detection-and-tracking-app.streamlit.app/)**Note**: In the demo, Due to non-availability of GPUs, you may encounter slow video inferencing.
## Tracking With Object Detection Demo
## Overview
## Demo Pics
### Home page
### Page after uploading an image and object detection
### Segmentation task on image
## Requirements
Python 3.6+
YOLOv8
Streamlit```bash
pip install ultralytics streamlit pytube
```## Installation
- Clone the repository: git clone
- Change to the repository directory: `cd yolov8-streamlit-detection-tracking`
- Create `weights`, `videos`, and `images` directories inside the project.
- Download the pre-trained YOLOv8 weights from () and save them to the `weights` directory in the same project.## Usage
- Run the app with the following command: `streamlit run app.py`
- The app should open in a new browser window.### ML Model Config
- Select task (Detection, Segmentation)
- Select model confidence
- Use the slider to adjust the confidence threshold (25-100) for the model.One the model config is done, select a source.
### Detection on images
- The default image with its objects-detected image is displayed on the main page.
- Select a source. (radio button selection `Image`).
- Upload an image by clicking on the "Browse files" button.
- Click the "Detect Objects" button to run the object detection algorithm on the uploaded image with the selected confidence threshold.
- The resulting image with objects detected will be displayed on the page. Click the "Download Image" button to download the image.("If save image to download" is selected)## Detection in Videos
- Create a folder with name `videos` in the same directory
- Dump your videos in this folder
- In `settings.py` edit the following lines.```python
# 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'.
```- Click on `Detect Video Objects` button and the selected task (detection/segmentation) will start on the selected video.
### Detection on RTSP
- Select the RTSP stream button
- Enter the rtsp url inside the textbox and hit `Detect Objects` button### Detection on YouTube Video URL
- Select the source as YouTube
- Copy paste the url inside the text box.
- The detection/segmentation task will start on the YouTube video url## Acknowledgements
This app uses [YOLOv8]() for object detection algorithm and [Streamlit]() library for the user interface.
### Disclaimer
This project is intended as a learning exercise and demonstration of integrating various technologies, including:
- Streamlit
- YoloV8
- Object-Detection on Images And Live Video Streams
- Python-OpenCVPlease 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.
### Hit star ⭐ if you like this repo!!!