Skip to content

Repository files navigation

People-Counting

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.

Introduction

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.

Before you run

  1. Clone the repository recursively:

git clone https://github.com/sentiers/People-Counting.git

  1. 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 sources

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

Select a Yolov5 family model

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

Simple Web Application

Can be run in localhost:8080 by

npm start

Reference

Yolov5, Yolov5 DeepSort

About

Enhancing people counting algorithm to achieve more accurate counting when using YOLO models with small datasets

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages