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.
The license information of this project is described in the file "LICENSE.txt".
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}
}
- Requirements: software
- Requirements: hardware
- Basic installation
- Demo
- Usage
- Download pre-trained models
- Download a dataset
- Remarks
- Acknowledgements
-
Use a Linux distribution. We have been developed and tested the code on Ubuntu.
-
Requirements for
Caffe
andpycaffe
(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
- Python packages you might not have:
cython
,python-opencv
,easydict
,opencv
.
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.
-
For training, we recommend having a GPU with at least 3GB of memory.
-
For testing, a GPU with 2GB memory is enough.
-
Be sure you have added to your
PATH
thetools
directory of yourCaffe
compilation:export PATH=$CAFFE_ROOT/build/tools:$PATH
-
Be sure you have added your
pycaffe
compilation into yourPYTHONPATH
:export PYTHONPATH=$CAFFE_ROOT/python:$PYTHONPATH
-
Download the TRANCOS dataset by executing the following command:
./tools/get_trancos.sh
-
Download the TRANCOS CCNN model. Comming soon
After successfully completing basic installation, you'll be ready to run the demo.
```
./tools/demo.sh
```
To train an test your own model, you should follow the next steps:
-
Edit the configuration file "ccnn_trancos_cfg.yml" placed into the corresponding model folder (e.g.: $PROJECT/models/trancos/ccnn).
-
Edit the launching script (e.g.: $PROJECT/experiments/scripts/trancos_train_test.sh):
-
Place you in $PROJECT folder and run the launching script by typing:
./experiments/scripts/trancos_train_test.sh
Comming soon...
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:
-
./tools/get_trancos.sh
-
./tools/get_ucsd.sh
-
./tools/get_ucf.sh
Note: Make sure the folder "data/" does not already contain the dataset.
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.
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.