This project showcases an object tracking system that employs YOLOv8 for detection and integrates a Kalman filter for tracking, thereby implementing the DeepSORT algorithm. It is designed to identify and follow objects within a video stream.
The project is organized into two main folders:
system: Contains the main codebase for the object tracking system.
detector_model_file
: Directory to store the trained YOLOv8 model weights.models
: Contains the implementation of various models used in the system (e.g., YOLOv8, Kalman filter).utils
: Contains utility functions and classes.detect.py
: Script to run the object detection and tracking on a video file.test.mp4
: Sample video file for testing the system.tracker.py
: Main script for the object tracking system.training: Contains the Jupyter notebook for training the YOLOv8 model.
train.ipynb
: Jupyter notebook with the code for training the YOLOv8 model.runs/detect/train9/weights
: Directory where the trained model weights are saved.https://github.com/user-attachments/assets/28b75fbd-2915-4bde-b23e-5ad19dc6ce17
git clone https://github.com/yourusername/your-repo.git
cd your-repo
Install the required dependencies: Its upto you if you want to make a virtual environment, if yes then write following commands in the terminal:
pip install virtualenv
python -m virtualenv venv
./venv/Scripts/activate
Install the requirements using following command
pip install -r requirements.txt
In the training directory, we have jupyter notebook file which can be run cell wise to train the model. The weights will get trained and stored in runs/detect/train/weights/best.pt (model files will be present in the recent train folder which will be made with each train try) Copy the weights to system/detector_model_file/ and use this trained weights for detection.
cd ../system
python detect.py
The project requires the following dependencies, which are listed in requirements.txt:
Ensure all dependencies are installed by running:
pip install -r requirements.txt
This project is licensed under the MIT License. See the LICENSE file for details.
Thanks to the YOLOv8 and Ultralytics teams for their excellent work on the YOLO object detection framework.
Thanks to the OpenCV community for their powerful computer vision library.
Feel free to contribute to this project by submitting issues or pull requests.