GithubHelp home page GithubHelp logo

wk910930 / crowd_density_segmentation Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 10.0 10.69 MB

The code for preparing the training data for crowd counting / segmentation algorithm.

License: MIT License

MATLAB 100.00%
caffe detection segmentation density pedestrian-detection matlab

crowd_density_segmentation's Introduction

Crowd Density & Segmentation Prediction

This project is the implementation and extension of the previous work, which is based on patches. For more details, please refer to the original paper.

Citation

Please cite the original paper in your publications if it helps your research:

@inproceedings{zhang2015cross,
  title={Cross-scene crowd counting via deep convolutional neural networks},
  author={Zhang, Cong and Li, Hongsheng and Wang, Xiaogang and Yang, Xiaokang},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  pages={833--841},
  year={2015}
}

Requirements: software

Caffe and MATLAB 2014a or above are required. Notice: A modified version of Caffe is requried.

Installation

  1. Clone the repository
# Make sure to clone with --recursive
git clone https://github.com/wk910930/crowd_density_segmentation.git
  1. Build Caffe (Code is private for now)
# Currently the code is not allowed to be public.

Prepare training data

We will call the directory that you cloned $CROWD_ROOT. We have prepared a toy dataset called dataset_01, which is used to demonstrate how to generate training data. Place your own dataset(s) under the data for further research.

  1. Generate density map
    cd $CROWD_ROOT/scripts
  2. Convert to Leveldb
    • Training the model needs three leveldb datasets, i.e. data_db, regression_db and segment_db, which stores the frames, segmentation masks and density maps, respectively.
    • Converting to Leveldb needs the Caffe, which is private for now.
    # Notice:
    #   jpg_id is the file list contains all frame crops, which can be generated by the command `ls sub_frames/*.jpg`. It looks like:
    #       xxxxxxx01.jpg
    #       xxxxxxx02.jpg
    #       xxxxxxx03.jpg
    #       xxxxxxx04.jpg
    #       ...
    #   Similar to png_id and mat id.
    
    # Example:
    #
    # Convert frame crops to leveldb
    ./caffe/build/tools/convert_imageset.bin -backend leveldb /path/to/sub_frames/ jpg_id data_db
    # Convert segment crops to leveldb
    ./caffe/build/tools/convert_imageset.bin -backend leveldb -gray /path/to/sub_segs/ png_id segment_db
    # Convert density crops to leveldb
    ./caffe/build/tools/convert_matset.bin -backend leveldb -height 256 -width 256 -varname crop_dens /path/to/sub_density/ mat_id regression_db

crowd_density_segmentation's People

Contributors

wk910930 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

crowd_density_segmentation's Issues

about how to generate perspective map

hello! could you give me some ideas to generate perspective map,the code has no much information about how to generate perspective map.thank you very much

about 3 meter x 3 meter

hello,thank for your information about paper. I still have a problem about how to crop a 3meter x 3meter form source image,I notice that when I use perspective map to crop 3x3 region from source image, I think it is rectangle but not square,also The paper says that extract 72x72 piece from source image ,is all like this for far or near in source image? but the perspective value is not the same, whether 72x72 piece can make sure the 3meter x3meter region in actual region from source image experss it

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.