An online multi-object counting method based on YOLO and tracking-by-detection (i.e., StrongSORT and ByteTrack). The tracking implementation is based on yolo_tracking.
Contrary to prevalent tracking algorithms, which output Track ID, our MultiMap algorithm maps each Track ID to a counting indicator based on the object class, and writes them to frames.
conda create -n yolo_counter python=3.8
conda activate yolo_counter
python -m pip install -r /path/to/requirements.txt
python count.py --tracking-method strongsort --source video.mp4 --yolo-weights trained_best.pt --reid-weights osnet_x0_25_msmt17.pt --classes 0 1
@article{zhou2024advancing,
title={Advancing tracking-by-detection with MultiMap: Towards occlusion-resilient online multiclass strawberry counting},
author={Zhou, Xuehai and Zhang, Yuyang and Jiang, Xintong and Riaz, Kashif and Rosenbaum, Phil and Lefsrud, Mark and Sun, Shangpeng},
journal={Expert Systems with Applications},
year={2024},
publisher={Elsevier}
}
Please contact me (xuehai.zhou@mail.mcgill.ca) if you have any questions!