Skip to content

MillX2021/ccnn

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Towards perspective-free object counting with deep learning

By Daniel Oñoro-Rubio and Roberto J. López-Sastre.

GRAM, University of Alcalá, Alcalá de Henares, Spain.

This is the official code implementation of work described the paper. In this repository, we include the implementation of CCNN and Hydra.

License

The license information of this project is described in the file "LICENSE.txt".

Cite us

Was our code useful for you? Please cite us:

@inproceedings{onoro2016,
    Author = {O\~noro-Rubio, D. and L\'opez-Sastre, R.},
    Title = {Towards perspective-free object counting with deep learning},
    Booktitle = {ECCV},
    Year = {2016}
}

Contents

  1. Requirements: software
  2. Requirements: hardware
  3. Basic installation
  4. Demo
  5. Usage
  6. Download pre-trained models
  7. Download a dataset
  8. Remarks
  9. Acknowledgements

Requirements: software

  1. Use a Linux distribution. We have been developed and tested the code on Ubuntu.

  2. Requirements for Caffe and pycaffe (see: Caffe installation instructions).

Note: Caffe must be built with support for Python layers!

# In your Makefile.config, make sure to have this line uncommented
WITH_PYTHON_LAYER := 1
  1. Python packages you might not have: cython, python-opencv, easydict, opencv.

Requirements: hardware

This code allows the usage of CPU and GPU. We strongly recommend the usage the GPU due it is going to short the training and testing time by a factor of 10 or so.

  1. For training, we recommend having a GPU with at least 3GB of memory.

  2. For testing, a GPU with 2GB memory is enough.

Installation (sufficient for the demo)

  1. Be sure you have added to your PATH the tools directory of your Caffe compilation:

    export PATH=$CAFFE_ROOT/build/tools:$PATH
  2. Be sure you have added your pycaffe compilation into your PYTHONPATH:

    export PYTHONPATH=$CAFFE_ROOT/python:$PYTHONPATH
  3. Download the TRANCOS dataset by executing the following command:

    ./tools/get_trancos.sh
  4. Download the TRANCOS CCNN model. Comming soon

Demo

After successfully completing basic installation, you'll be ready to run the demo.

```
./tools/demo.sh
```

Usage

To train an test your own model, you should follow the next steps:

  1. Edit the configuration file "ccnn_trancos_cfg.yml" placed into the corresponding model folder (e.g.: $PROJECT/models/trancos/ccnn).

  2. Edit the launching script (e.g.: $PROJECT/experiments/scripts/trancos_train_test.sh):

  3. Place you in $PROJECT folder and run the launching script by typing:

    ./experiments/scripts/trancos_train_test.sh

Download pre-trained models

Comming soon...

Download a dataset

In order to download and setup a dataset we recommend to use our scripts. To do so, just place you in the $PROJECT directory and run one of the following commands:

Note: Make sure the folder "data/" does not already contain the dataset.

Remarks

In order to provide a better distribution, this repository unifies and reimplement in Python some of the original modules. Due the changes in the libraries, the results produced by the pretrained models may have been slightly changed with respect to the numbers provided in the paper.

Acknowledgements

This work is supported by the projects of the DGT with references SPIP2014-1468 and SPIP2015-01809, and the project of the MINECO TEC2013-45183-R.

About

Counting CNN and Hydra CNN

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 88.5%
  • Shell 11.5%