Giter Site home page Giter Site logo

priyanka-kasture / crowd-counting-with-mcnns Goto Github PK

View Code? Open in Web Editor NEW
24.0 2.0 10.0 6.26 MB

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

License: MIT License

Python 100.00%
tensorflow keras neural-network convolutional-neural-networks crowdcounting crowd-counting python matlab shanghaitech

crowd-counting-with-mcnns's Introduction

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/

crowd-counting-with-mcnns's People

Contributors

priyanka-kasture avatar

Stargazers

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

Watchers

 avatar  avatar

crowd-counting-with-mcnns's Issues

type error!

Hello, I have this problem:
Image Loading!
Traceback (most recent call last):
File "test.py", line 26, in
mcnn.predict()
File "C:\Users\Administrator\Crowd-Counting-with-MCNNs\network.py", line 286, in predict
img = (img - 127.5) / 128
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'

an array type can't be broadcast? I don't know what it is mean.

The keras model size~

Hello, I am testing different models to compare their performance.
I am confused about keras model size :'weights.h5' 562kB.
Thanks a lot.

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.