Skip to content

Crowd counting on the ShanghaiTech dataset, using multi-column convolutional neural networks.

License

Notifications You must be signed in to change notification settings

priyanka-kasture/Crowd-Counting-with-MCNNs

Repository files navigation

Crowd Counting with MCNNs - MindSpark Hackathon 2018


Crowd counting on the ShanghaiTech dataset, using multi-column convolutional neural networks.

This is an unofficial implementation of CVPR 2016 paper "Single Image Crowd Counting via Multi Column Convolutional Neural Network".

Note: Predictions can be made. The work on heatmap generation in under progress.

Installation

  • Install Tensorflow and Keras
  • Install OpenCV
  • Clone this repository (in case you don't want train the model and want to use the pre-trained one).

Data Setup

Download ShanghaiTech Dataset from:


Create a folder: ROOT/data/original/shanghaitech/

Here ROOT is the folder conatining all files, it's the main folder. (Don't create a folder called ROOT!)
  • Save "part_A" under ROOT/data/original/shanghaitech/
  • Save "part_B" under ROOT/data/original/shanghaitech/
  • Got to ROOT/data_preparation/
  • There, run create_gt_test_set_shtech.m in matlab/octave to create ground truth files for test data.
  • Then go to ROOT/data_preparation/ again.
  • run create_training_set_shtech.m in matlab to create training and validataion set along with ground truth files.

- Save the ground truth csv files in ROOT/data/
That completes data-setup!

Test


- Save the model files under: ROOT/final_models
- Finally run: test.py

Train

  • Not recommended unless you have a great processor, or a GPU, because training takes a lot of time. Load the pre-trained model and test it on the test set instead.

  • For tensorflow:
    run from prompt: python3 train.py A(or B)
    Model is saved to modelA/ or modelB/.

  • For keras: run: python3 keras_train.py B
    model is saved to keras_modelB/

Releases

No releases published

Packages

No packages published

Languages