Official Implement for the paper《Synthetic Guided Domain Adaptive and Edge Aware Network for Crowd Counting》that published in the journal 《Image and Vision Computing》. In this project, you train a CSRNet or our SGEANet on ShanghaiTech dataset.
The folders are organized as follows:
- data: dataset processing code, image list file, the soft link of dataset folders.
- experiment: config file for training, testing.
- images: images to show on this readme.md
- main: two main scripts, train.py and val.py.
- src: all other codes
- pytorch=1.1.0
- torchvision
- progressbar
- visdom
- Download ShanghaiTech dataset from Shanghaitech
- Create soft link to the data folder in this project
ln -s to/path/ShanghaiTech_PartA data/SHA
- Generate synthetic data, density map ground truth, save gt number and make a image list file in json format.
python data/prepare_dataset/SHA/make_ga_synthetic.py
python data/prepare_dataset/SHA/make_ga_gt.py
python data/prepare_dataset/SHA/save_gt_num.py
python data/prepare_dataset/SHA/make_json.py
sh train.sh experiment/SHA/SGEANet/syn_baseline.yaml
sh train.sh experiment/SHA/SGEANet/real_baseline.yaml
sh train.sh experiment/SHA/SGEANet/real_baseline_LSG_LME.yaml
sh val.sh experiment/SHA/SGEANet/syn_baseline.yaml
sh val.sh experiment/SHA/SGEANet/real_baseline.yaml
sh val.sh experiment/SHA/SGEANet/real_baseline_LSG_LME.yaml
Bellow is a demo of predicted density maps from different methods.
If you use this code for your research, please cite our paper: