Git Product home page Git Product logo

counting-with-focus-for-free's Introduction

Counting-with-Focus-for-Free

Zenglin Shi, Pascal Mettes, and Cees G. M. Snoek. Counting with Focus for Free, ICCV, 2019 image

                  Overview of our approach

Requirements

1. CUDA 8.0 and Cudnn 7.5 or higher
2. GPU memory 10GB or higher
3. Python 2.7
4. Tensorflow 1.04 or or higher

Data preprocessing

Datasets

1. ShanghaiTech partA and partB
2. TRANCOS
3. Dublin Cell Counting
4. WIDER FACE
5. UCF-QNRF

Density map generation

Bsed on equation (1) and (7), for datasets with dense objects, ie, ShanghaiTech Part_A, TRANCOS and UCF-QNRF, we use our proposed non-uniform kernel with beta=0.3 and k=5. For ShanghaiTech Part_B and DCC, we set the Gaussian kernel variance to sigma=5 and sigma=10 respectively. For WIDER FACE, we obtain the Gaussian kernel variance by leveraging the box annotations. You can find the code in folder ¨data/getDmap.m¨.

Segmentation map generation

Bsed on equation(2), we use the same sigma as density map generation. You can find the code in folder ¨data/getPmap.m¨.

Global density generation

Bsed on equation(4) and (5), we use M=8 density levels for ShanghaiTech Part_A and UCF-QNRF, and 4 for the other datasets.

Training

1. Prepare your data following the step of ¨data preprocessing¨.
2. Set the experiment settings in ¨code/tr_param.ini¨ in which phase = train, and set other parameters accordingly (refer to our paper).
3. Run ¨python code/main.py¨

Testing

1. Prepare your data following the step of ¨data preprocessing¨.
2. Set the experiment settings in ¨code/tr_param.ini¨ in which phase = test, and set other parameters accordingly (refer to our paper).
3. Run ¨python code/main.py¨

Tips

1. The dataload function in this code is a little bit slow, you can impove it by using Dataset API in TF.
2. Please generate your groundtruth map following the step of ¨data preprocessing¨ if you want to reproduce our reported numbers in Table 6.
3. You may get different results for each run because some random functions are used even with a fixed random seeds.
4. If you have any questions, feel free to post them in ¨Issues¨.
5. You can find more information at my homepage

Citation

Please cite our paper when you use this code.
 @inproceedings{shi2019counting,
 title={Counting with Focus for Free},
 author={Zenglin Shi, Pascal Mettes, and Cees G. M. Snoek},
 booktitle={ICCV},
 year={2019}
 }

counting-with-focus-for-free's People

Contributors

shizenglin avatar

Watchers

 avatar

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.