Code for Unsupervised crowd counting via cross-domain feature adaptation.

Pre-trained models

Google Drive

Baidu Cloud : t4qc


We are good in the environment:

python 3.6

CUDA 9.2

Pytorch 1.2.0

numpy 1.19.2

matplotlib 3.3.4


We provide the test code for our model. The result_gcc_qnrf.pth model is adapted from the GCC dataset to the UCF_QNRF dataset. We randomly select an image from the UCF_QNRF dataset and place it in the image folder. And you can either choose the other images for a test.

We are good to run:

python --model CDFA --model_state ./model/result_gcc_qnrf.pth --out ./out/out.png

We will release more pre-trained models soon. Please see the paper for more details.


Coming soon


Thanks to these repositories

GitHub - gcding/CDFA-pytorch at
Code for Crowd counting via unsupervised cross-domain feature adaptation. - GitHub - gcding/CDFA-pytorch at