This is a caffe implementation of CSRNet for crowd counting.
matlab (2015b)
OpenCV (2.4.13)
Because add lmdb2txt tool to caffe
cd caffe-CSRNet
mkdir build
cd build
cmake ..
make -j8
https://drive.google.com/file/d/16dhJn7k4FWVwByRsQAEpl9lwjuV03jVI/view
1. cd readPicList
2. python3 readPicList.py -i ../ShanghaiTech_Crowd_Counting_Dataset/part_A_final/train_data/images -o train_list.txt
3. python3 addSuffix.py --inputfile train_list.txt --outputfile_csv label.txt --outputfile_jpg img_train.txt
copy readPicList/train_list.txt
to generate_density
folder and modify create_gt_train_set.m
corresponding path, then run create_gt_train_set.m
, the generated density map will be saved in ground_truth_csv
folder.
note:modify the corresponding include and link path in CMakeList file
eg./home/ozh/share/caffe/build/lib
-->path/to/caffe/build/lib
cd csv2lmdb
mkdir build
cd build
make
cd ../bin
./csv2lmdb --lmdb_path /home/ozh/share/test/lmdb/ground_truth --csv_list ../../readPicList/label.txt --ground_truth_path ../../ShanghaiTech_Crowd_Counting_Dataset/part_A_final/train_data/ground_truth_csv/
sh create_lmdb.sh
(modify the corresponding path)
http://www.robots.ox.ac.uk/~vgg/software/very_deep/caffe/VGG_ILSVRC_16_layers.caffemodel
sh train_CSRNet.sh
(modify the corresponding path)
run crowd_test.m (modify the test_list.txt in deploy.prototxt)