Coder Social home page Coder Social logo

marcelo5647 / decoupled_two-stage_counting Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hustaia/decoupled_two-stage_counting

0.0 0.0 0.0 835 KB

This fork was created to test D2CNet on a new crowd localization dataset.

Python 90.87% MATLAB 9.13%

decoupled_two-stage_counting's Introduction

Decoupled Two-Stage Counting

This repository includes the official implementation of D2CNet for crowd counting and localization, presented in our paper:

Decoupled Two-Stage Crowd Counting and Beyond

IEEE Transactions on Image Processing, 2021

Jian Cheng, Haipeng Xiong, Zhiguo Cao, Hao Lu

Huazhong University of Science and Technology

equal contribution

Overview

Visualization

Highlights

  • New representation of crowd: We introduce the concept of the probability map which describes the probability of a point being an object;
  • Simple and effective: With only a basic network architecture and simple training procedures, D2CNet obtains state-of-the-art counting and localization performance;
  • Multifunctional: D2C framework not only unifies object counting and object localization but also enables synthesized data augmentation and flexible counting error diagnosis.

Installation

The code has been tested on Python 3.7.6 and PyTorch 1.5.0. Please follow the official instructions to configure your environment. See other required packages in requirements.txt.

Data Preparation

  1. Download the official ShanghaiTech and UCF_QNRF dataset under ./data. Resize images in UCF_QNRF to ensure the longer side is not greater than 1920.
cd prepare_dataset
python normalize_QNRF.py
  1. Generate synthesized dataset by running generate_synthesized_dataset/main.m in Matlab.

  2. Generate probability maps, density maps and dot maps. It may take several days to prepare the UCF_QNRF dataset, so it's better to split it into several parts and prepare them in parallel.

python make_dataset.py
  1. Generate json files of training and testing data.
cd ..
python prepare_dataset/filepath2json.py ./data/shanghaitech/part_A_final/train_data/images/ part_A_train.json

Training

python train.py part_A_train.json part_A_test.json 0 0

Testing

Download the pretrained models to the main folder.

PartA (MAE: 55.673, MSE: 87.161) BaiduYun (code: 3qal)

PartB (MAE: 6.367, MSE: 10.716) BaiduYun (code: ybfp)

QNRF (MAE: 81.698, MSE: 137.925) BaiduYun (code: xrjq)

python train.py --pre partA.pth.tar part_A_train.json part_A_test.json 0 0 --mode 1

Mode 1 is for counting evaluation, and mode 2 is for localization evaluation.

Permission

The code are only for non-commercial purposes. Copyrights reserved.

Contact: Jian Cheng ([email protected]) and Hao Lu ([email protected])

decoupled_two-stage_counting's People

Contributors

hustaia avatar poppinace 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.