This project is a fork of the awesome yolov5 from Glenn Jocher which is implemented in PyTorch, with added files from ByteTrack (in the object-tracker folder). I have used this for counting eggs in a video for easter;
I trained the model using the guidelines given by the yolov5 repository, see their tutorials here:
- Train Custom Data 🚀 RECOMMENDED
- Tips for Best Training Results ☘️ RECOMMENDED
- Weights & Biases Logging 🌟 NEW
- Roboflow for Datasets, Labeling, and Active Learning 🌟 NEW
- Multi-GPU Training
- PyTorch Hub ⭐ NEW
- TFLite, ONNX, CoreML, TensorRT Export 🚀
- Test-Time Augmentation (TTA)
- Model Ensembling
- Model Pruning/Sparsity
- Hyperparameter Evolution
- Transfer Learning with Frozen Layers ⭐ NEW
- Architecture Summary ⭐ NEW
This project was used because we can gain very fast inference, while also being simple to train and had good performance
Then I added the object tracking folder from Bytetrack, which was chosen because I could do simple multiple object tracking by detection with MOTA performance, and therefore not relying on tagging id's of the movements of every object myself. This was easy to use out of the box with any object detection model. ByteTrack has shown good MOTA performance
ByteTrack: Multi-Object Tracking by Associating Every Detection Box
Yifu Zhang, Peize Sun, Yi Jiang, Dongdong Yu, Zehuan Yuan, Ping Luo, Wenyu Liu, Xinggang Wang
The result being
First, do
- Do annotations in label-studio and export to yolo format
Make labelstudio
- Create relevant files for yolov5 as specified in the train custom model tutorial
- Train the model as specified in the tutorial
- Do detection on your on video by running
python3 detect.py --source <YOUR_VIDEO> --data <YOUR_DATA_SPEC> --weights <YOUR_BEST_TRAINED_WEIGHTS>
Dependencies are installed with poetry, which is installed using
curl -sSL https://github.com/raw/python-poetry/poetry/master/get-poetry.py | python -
Most likely you would also like your virtual environment to reside in the project folder, do once as
poetry config virtualenvs.in-project true
Link to your version of python using
poetry env use <python-version>
And you can install the dependencies using
poetry install (or update)
- Martin Højland - Initial work - hojland
See also the list of contributors who participated in this project.
Big acknowledgements to authors of Yolov5 and ByteTrack