Giter Club home page Giter Club logo

csrnet-caffe's Introduction

CSRNet-caffe

This is a caffe implementation of CSRNet for crowd counting.

Dependencies

matlab (2015b)
OpenCV (2.4.13)

How to use?

caffe build

Because add lmdb2txt tool to caffe

cd caffe-CSRNet
mkdir build
cd build
cmake ..
make -j8

prepare data

download Shanghai dataset

https://drive.google.com/file/d/16dhJn7k4FWVwByRsQAEpl9lwjuV03jVI/view

generate data list

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

generate density map

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.

convert ground_truth(.csv) to lmdb

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/

convert data(.jpg) to lmdb

sh create_lmdb.sh (modify the corresponding path)

download pretrain model vgg16

http://www.robots.ox.ac.uk/~vgg/software/very_deep/caffe/VGG_ILSVRC_16_layers.caffemodel

train

sh train_CSRNet.sh (modify the corresponding path)

test

run crowd_test.m (modify the test_list.txt in deploy.prototxt)

csrnet-caffe's People

Contributors

ou-zhi-hui avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.