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.
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
- 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. - Video: It can be a video file stored in the videos folder or a URL to the video.
git clone https://github.com/niveditarufus/PeopleCounter-SSDCNet.git
cd PeopleCounter-SSDCNet
pip3 install -r requirements.txt
Usage: python3 Run.py [--model MODEL] [--video LIST OF VIDEO FILES/URL] [--filter METHOD]
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.
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.
python3 Run.py --model model3 --video f1.mp4 f2.mp4 --filter kf --skip_frames 30 --stitch False