Skip to content

Computer Vision Final Project, Crowd counting + density map

License

Notifications You must be signed in to change notification settings

amindehnavi/Crowd-Counting-P2PNet

Repository files navigation

Crowd Counting

Computer Vision Final Project, Crowd counting + density map

Introduction

in this project we used P2PNet model [Paper][Github repo] to estimate number of people in crowd scences.

Setup

  1. clone this repository: git clone https://github.com/amindehnavi/Crowd-Counting-P2PNet
  2. change the current directory into CrowdCounting-P2PNet folder: cd CrowdCounting-P2PNet
  3. install requirements libraries using pip install -r requirements.txt command.
  4. download the vgg16-bn/vgg16 pretrained weight on ImageNet and put it in checkpoints folder

Demo

to run the model on a some images set video, run the following command
CUDA_VISIBLE_DEVICES=0 python run_test.py --weight_path ./weights/SHTechA.pth --output_dir ./output/ --device cuda --shape 640 480 --threshold 0.75 --images --images_dir ./Dataset --density_map

to test on a video
CUDA_VISIBLE_DEVICES=0 python run_test.py --weight_path ./weights/SHTechA.pth --output_dir ./output/ --device cuda --shape 640 480 --threshold 0.75 --video --video_path /path/to/video

Note 1: to get the density map, set the --density_map flag in command line.
Note 2: to add the density map on original image, set the --add_density_to_image flag in command line.

About

Computer Vision Final Project, Crowd counting + density map

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published