Awesome
CSRNet-Simple-Pytorch
This is an simple and clean implemention of CVPR 2018 paper "CSRNet: Dilated Convolutional Neural Networks for Understanding the Highly Congested Scenes".
Requirement
- Install pytorch 1.0.0+
- Install tensorboardX
- Clone this repository
We'll call the directory that you cloned CSRNet-pytorch as ROOT.git clone https://github.com/CommissarMa/CSRNet-pytorch.git
Data Setup
- Download ShanghaiTech Dataset from Dropbox or Baidu Disk (code: a2v8)
- Put ShanghaiTech Dataset in 'ROOT/data'. You can find two python scripts in 'data_preparation' folder which are used to generate ground truth density-map for ShanghaiTech PartA and PartB respectively. (Mind that you need move the script to corresponding sub dataset folder like 'ROOT/data/part_A_final' and run it)
Train
- Modify the dataset root in 'config.py'
- Run 'train.py'
- Open the command line and type in 'tensorboard --logdir=ROOT/runs', then browse 'localhost:6006' to see the visual result.
Testing
- Run 'test.py' for calculate MAE of test images or just show an estimated density-map.
Other notes
- We trained the model and got 67.74 MAE at 124-th epoch on ShanghaiTech PartA. Got 8.68 MAE on PartB at 94-th epoch.
- If you are new to crowd counting, we recommand you to take a look at Crowd_counting_from_scratch first. It is a tutorial for crowd counting beginner.