This repository is a comprehensive open-source project that demonstrates the integration of object detection and tracking using the YOLOv8 object detection algorithm and Streamlit, a popular Python web application framework for building interactive web applications. This project provides a user-friendly and customizable interface that can detect and track objects in real-time video streams.
Tracking-With_object-Detection-MOV.mov
Python 3.6+ YOLOv8 Streamlit
pip install ultralytics streamlit pafy
- Clone the repository: git clone https://github.com/syedrz/yolov8-detection-segmentation-tracking.git
- Change to the repository directory:
cd yolov8-detection-segmentation-tracking
- Create
weights
,videos
, andimages
directories inside the project. - Download the pre-trained YOLOv8 weights from (https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt) and save them to the
weights
directory in the same project.
- Run the app with the following command:
streamlit run app.py
- The app should open in a new browser window.
- 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.
- 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)
- Drag and drop video file
- Click on
Detect Video Objects
button and the selected task (detection/segmentation) will start on the selected video.
- Select the RTSP stream button
- Enter the rtsp url inside the textbox and hit
Detect Objects
button
- Select the source as YouTube
- Copy paste the url inside the text box.
- The detection/segmentation task will start on the YouTube video url
movobjdetyoutubeurl.mov
This app is based on the YOLOv8(https://github.com/ultralytics/ultralytics) object detection algorithm. The app uses the Streamlit(https://github.com/streamlit/streamlit) library for the user interface.
Please note that this project is intended for educational purposes only and should not be used in production environments.
Hit star ⭐ if you like this repo!!!