Home

Awesome

Crowd Counting Code Framework (C^3-Framework)

Python 3 dev version!

An open-source PyTorch code for crowd counting


Note: Due to personal reasons, the code will not continue to be maintained. I suggest you use NWPU-Crowd-Sample-Code or use other excellent code in Awesome-Crowd-Counting.

Technical Blog

Goal

The purpose of this code is an efficient, flexible framework for supervised crowd counting. At the same time, we provide the performances of some basic networks and classic algorithms on the mainstream datasets.

Features

Performance

Due to limited spare time and the number of GPUs, I do not plan to conduct some experiments (named as "TBD"). If you are interested in the project, you are welcomed to submit your own experimental parameters and results. GCC(rd,cc,cl) stand for GCC dataset using random/cross-camera/cross-location/ splitting, respectively.

MethodGCC(rd,cc,cl)UCF-QNRFSHT ASHT B
MCNN (RGB Image)102.2/238.3, 140.3/285.7, 176.1/373.9243.5/364.7110.6/171.121.5/38.1
AlexNet (conv5)46.3/110.9, 83.7/180.3, 101.2/233.6TBDTBD13.6/21.7
VGG-16 (conv4_3)36.6/88.9, 57.6/133.9, 91.4/222.0119.3/207.771.4/115.710.3/16.5
VGG-16 (conv4_3)+decoder37.2/91.2, 56.9/138.3, 88.9/220.9115.2/189.671.5/117.610.5/17.4
ResNet-50 (layer3)32.4/76.1, 54.5/129.7,78.3/201.6114.7/205.7TBD7.7/12.6
ResNet-101 (layer3)31.9/81.4, 56.8/139.5, 86.9/214.2TBDTBD7.6/12.2
CSRNet32.6/74.3, 54.6/135.2, 87.3/217.2TBD69.3/111.910.6/16.6
SANet42.4/85.4, 79.3/179.9, 110.0/246.0TBDTBD12.1/19.2
CMTL-TBDTBD14.0/22.3
ResSFCN-101 (SFCN+)26.8/66.1, 56.5/139.0, 83.5/211.5112.67/198.27TBD7.8/12.6
MethodWEUCF50
MCNN (RGB Image)TBDTBD
AlexNet (conv5)TBDTBD
VGG-16 (conv4_3)TBDTBD
VGG-16 (conv4_3)+decoderTBDTBD
ResNet-50 (layer3)TBDTBD
ResNet-101 (layer3)TBDTBD
CSRNetTBDTBD
SANetTBDTBD
CMTLTBDTBD
ResSFCN-101 (SFCN+)TBDTBD

data processing code

Getting Started

Preparation

Training

Testing

We only provide an example to test the model on the test set. You may need to modify it to test your own models.

Pretrained Models on GCC

Considering the large-scale GCC, we provide the pretrained models on GCC using random splitting to save the researcher's training time. You can download them from this link. Unfortunately, we've lost the MCNN model trained on GCC, and we will re-train and release it ASAP.

Tips

In this code, the validation is directly on the test set. Strictly speaking, it should be evaluated on the val set (randomly selected from the training set, which is adopted in the paper). Here, for a comparable reproduction (namely fixed splitting sets), this code directly adopts the test set for validation, which causes that the results of this code are better than that of our paper. If you use this repo for academic research, you need to select 10% training data (or other value) as validation set.

Citation

If you find this project is useful for your research, please cite:

@inproceedings{wang2019learning,
  title={Learning from Synthetic Data for Crowd Counting in the Wild},
  author={Wang, Qi and Gao, Junyu and Lin, Wei and Yuan, Yuan},
  booktitle={Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  pages-{8198--8207},
  year={2019}
}
@article{gao2019c,
  title={C$^3$ Framework: An Open-source PyTorch Code for Crowd Counting},
  author={Gao, Junyu and Lin, Wei and Zhao, Bin and Wang, Dong and Gao, Chenyu and Wen, Jun},
  journal={arXiv preprint arXiv:1907.02724},
  year={2019}
}