/PeopleCounter-GrpBvr

CLONED- https://github.com/niveditarufus/PeopleCounter-SSDCNet

Primary LanguagePython

PeopleCounter with SSDCNet

Introduction

This is a people counter module that is implemented using SS-DCNet. This module is equipped to to give the count of people present in a frame captured from a video.

Dependencies

Python==3.6
pytorch-lts pytorch) torchvision==0.5.0
conda-forge opencv Pillow==7.1.1
numpy==1.18.2
scipy==1.4.1

Inputs

  1. Model: There are three pretrained models available here. They were trained by the authors of the the paper on Shanghai Dataset(A, B) and QRNF dataset.[Note]: download the models to a folder called model in the repository.
  2. Video: It can be a video file stored in the videos folder or a URL to the video.

Quick Start

1. Clone the repository

git clone https://github.com/niveditarufus/PeopleCounter-SSDCNet.git

2. Run

cd PeopleCounter-SSDCNet

3. Install all dependencies required, run

pip3 install -r requirements.txt

4. Run Demo

Usage: python3 Run.py [--model MODEL] [--video LIST OF VIDEO FILES/URL] [--filter METHOD]

Example

python3 Run.py --model model3 --video m1.mp4 --filter kf --skip_frames 30
if a video(file/URL) was not supplied, a reference to the webcam will be grabbed.

You can also supply the a list of videos which have overlapping views.

This might cause some delay in relaying the count of people, so change the skip_frames parameter accordingly. This employs an image stitching on the images(as shown below) before returning the value of the count of people.

Example

python3 Run.py --model model3 --video f1.mp4 f2.mp4 --filter kf --skip_frames 30

If the videos are just from different perspectives(as shown below) and not really overlapping you will have to set the stitch parameter to False while parsing.

This employs Boyer-Moore's Majority Voting algorithm (Link) for the count of people.

Example

python3 Run.py --model model3 --video f1.mp4 f2.mp4 --filter kf --skip_frames 30 --stitch False

References

  1. SS-DCNet
  2. SS-DCNET code
  3. Image stitching
  4. Boyer-Moore's Majority Voting algorithm