people counting algorithm to achieve accurate counting when using yolo models with small datasets. This algorithm minimizes the counting error that occurs when there is a problem in object recognition and tracking.
This repository contains a two-stage-tracker. The detections generated by YOLOv5, a family of object detection architectures and models pretrained on the COCO dataset, are passed to a Deep Sort algorithm which tracks the objects. It can track any object that your Yolov5 model was trained to detect.
- Clone the repository recursively:
git clone https://github.com/sentiers/People-Counting.git
- Make sure that you fulfill all the requirements: Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install, run:
pip install -r requirements.txt
Tracking can be run on most video formats
python3 track.py --source ... --show-vid # show live inference results as well
- Video:
--source file.mp4
- Webcam:
--source 0
There is a clear trade-off between model inference speed and accuracy. In order to make it possible to fulfill your inference speed/accuracy needs you can select a Yolov5 family model for automatic download
$ python track.py --source 0 --yolo_weights yolov5s.pt --img 640
yolov5m.pt
yolov5l.pt
yolov5x.pt --img 1280
Can be run in localhost:8080 by
npm start