xuehai-zhou / MultiMap

GNU Affero General Public License v3.0
1 stars 0 forks source link

Multi-object counting in real-time videos

Demo

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.

Pipeline

Pipeline

Environment

conda create -n yolo_counter python=3.8
conda activate yolo_counter
python -m pip install -r /path/to/requirements.txt

Usage

python count.py --tracking-method strongsort --source video.mp4 --yolo-weights trained_best.pt --reid-weights osnet_x0_25_msmt17.pt --classes 0 1

If you find our code helpful for your research, please cite

@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!