PyTorch implementations of the paper: "DR.VIC: Decomposition and Reasoning for Video Individual Counting, CVPR, 2022"

Related tags

Deep LearningDRNet
Overview

DRNet for Video Indvidual Counting (CVPR 2022)

Introduction

This is the official PyTorch implementation of paper: DR.VIC: Decomposition and Reasoning for Video Individual Counting. Different from the single image counting methods, it counts the total number of the pedestrians in a video sequence with a person in different frames only being calculated once. DRNet decomposes this new task to estimate the initial crowd number in the first frame and integrate differential crowd numbers in a set of following image pairs (namely current frame and preceding frame). framework

Catalog

  • Testing Code (2022.3.19)
  • PyTorch pretrained models (2022.3.19)
  • Training Code
    • HT21
    • SenseCrowd

Getting started

preparatoin

  • Clone this repo in the directory (Root/DRNet):

  • Install dependencies. We use python 3.7 and pytorch >= 1.6.0 : http://pytorch.org.

    conda create -n DRNet python=3.7
    conda activate DRNet
    conda install pytorch==1.7.0 torchvision==0.8.0 cudatoolkit=10.2 -c pytorch
    cd ${DRNet}
    pip install -r requirements.txt
  • PreciseRoIPooling for extracting the feature descriptors

    Note: the PreciseRoIPooling [1] module is included in the repo, but it's likely to have some problems when running the code:

    1. If you are prompted to install ninja, the following commands will help you.
      wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip
      sudo unzip ninja-linux.zip -d /usr/local/bin/
      sudo update-alternatives --install /usr/bin/ninja ninja /usr/local/bin/ninja 1 --force 
    2. If you encounter errors when compiling the PreciseRoIPooling, you can look up the original repo's issues for help.
  • Datasets

    • HT21 dataset: Download CroHD dataset from this link. Unzip HT21.zip and place HT21 into the folder (Root/dataset/).
    • SenseCrowd dataset: To be updated when it is released.
    • Download the lists of train/val/test sets at link: dataset., and place them to each dataset folder, respectively.

Training

Check some parameters in config.py before training,

  • Use __C.DATASET = 'HT21' to set the dataset (default: HT21).
  • Use __C.GPU_ID = '0' to set the GPU.
  • Use __C.MAX_EPOCH = 20 to set the number of the training epochs (default:20).
  • Use __C.EXP_PATH = os.path.join('./exp', __C.DATASET) to set the dictionary for saving the code, weights, and resume point.

Check other parameters (TRAIN_BATCH_SIZE, TRAIN_SIZE etc.) in the Root/DRNet/datasets/setting in case your GPU's memory is not support for the default setting.

  • run python train.py.

Tips: The training process takes ~10 hours on HT21 dataset with one TITAN RTX (24GB Memory).

Testing

To reproduce the performance, download the pre-trained models and then place pretrained_models folder to Root/DRNet/model/

  • for HT21:
    • Run python test_HT21.py.
  • for SenseCrowd:
    • Run python test_SENSE.py. Then the output file (*_SENSE_cnt.py) will be generated.

Performance

The results on HT21 and SenseCrowd.

  • HT21 dataset
Method CroHD11~CroHD15 MAE/MSE/MRAE(%)
Paper: VGG+FPN [2,3] 164.6/1075.5/752.8/784.5/382.3 141.1/192.3/27.4
This Repo's Reproduction: VGG+FPN [2,3] 138.4/1017.5/623.9/659.8/348.5 160.7/217.3/25.1
  • SenseCrowd dataset
Method MAE/MSE/MRAE(%) MIAE/MOAE D0~D4 (for MAE)
Paper: VGG+FPN [2,3] 12.3/24.7/12.7 1.98/2.01 4.1/8.0/23.3/50.0/77.0
This Repo's Reproduction: VGG+FPN [2,3] 11.7/24.6/11.7 1.99/1.88 3.6/6.8/22.4/42.6/85.2

Video Demo

Please visit bilibili or YouTube to watch the video demonstration. demo

References

  1. Acquisition of Localization Confidence for Accurate Object Detection, ECCV, 2018.
  2. Very Deep Convolutional Networks for Large-scale Image Recognition, arXiv, 2014.
  3. Feature Pyramid Networks for Object Detection, CVPR, 2017.

Citation

If you find this project is useful for your research, please cite:

@article{han2022drvic,
  title={DR.VIC: Decomposition and Reasoning for Video Individual Counting},
  author={Han, Tao, Bai Lei, Gao, Junyu, Qi Wang, and Ouyang  Wanli},
  booktitle={CVPR},
  year={2022}
}

Acknowledgement

The released PyTorch training script borrows some codes from the C^3 Framework and SuperGlue repositories. If you think this repo is helpful for your research, please consider cite them.

Owner
tao han
tao han
Official code for "InfoGraph: Unsupervised and Semi-supervised Graph-Level Representation Learning via Mutual Information Maximization" (ICLR 2020, spotlight)

InfoGraph: Unsupervised and Semi-supervised Graph-Level Representation Learning via Mutual Information Maximization Authors: Fan-yun Sun, Jordan Hoffm

Fan-Yun Sun 232 Dec 28, 2022
A foreign language learning aid using a neural network to predict probability of translating foreign words

Langy Langy is a reading-focused foreign language learning aid orientated towards young children. Reading is an activity that every child knows. It is

Shona Lowden 6 Nov 17, 2021
3rd place solution for the Weather4cast 2021 Stage 1 Challenge

weather4cast2021_Stage1 3rd place solution for the Weather4cast 2021 Stage 1 Challenge Dependencies The code can be executed from a fresh environment

5 Aug 14, 2022
Edge-aware Guidance Fusion Network for RGB-Thermal Scene Parsing

EGFNet Edge-aware Guidance Fusion Network for RGB-Thermal Scene Parsing Dataset and Results Test maps: 百度网盘 提取码:zust Citation @ARTICLE{ author={Zhou,

ShaohuaDong 10 Dec 08, 2022
Syllabus del curso IIC2115 - Programación como Herramienta para la Ingeniería 2022/I

IIC2115 - Programación como Herramienta para la Ingeniería Videos y tutoriales Tutorial CMD Tutorial Instalación Python y Jupyter Tutorial de git-GitH

21 Nov 09, 2022
Source code for Acorn, the precision farming rover by Twisted Fields

Acorn precision farming rover This is the software repository for Acorn, the precision farming rover by Twisted Fields. For more information see twist

Twisted Fields 198 Jan 02, 2023
PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)

English | 简体中文 Welcome to the PaddlePaddle GitHub. PaddlePaddle, as the only independent R&D deep learning platform in China, has been officially open

19.4k Jan 04, 2023
Deep Hedging Demo - An Example of Using Machine Learning for Derivative Pricing.

Deep Hedging Demo Pricing Derivatives using Machine Learning 1) Jupyter version: Run ./colab/deep_hedging_colab.ipynb on Colab. 2) Gui version: Run py

Yu Man Tam 102 Jan 06, 2023
Code for A Volumetric Transformer for Accurate 3D Tumor Segmentation

VT-UNet This repo contains the supported pytorch code and configuration files to reproduce 3D medical image segmentaion results of VT-UNet. Environmen

Himashi Amanda Peiris 114 Dec 20, 2022
Polynomial-time Meta-Interpretive Learning

Louise - polynomial-time Program Learning Getting help with Louise Louise's author can be reached by email at Stassa Patsantzis 64 Dec 26, 2022

Implementation of the Chamfer Distance as a module for pyTorch

Chamfer Distance for pyTorch This is an implementation of the Chamfer Distance as a module for pyTorch. It is written as a custom C++/CUDA extension.

Christian Diller 205 Jan 05, 2023
Deep generative modeling for time-stamped heterogeneous data, enabling high-fidelity models for a large variety of spatio-temporal domains.

Neural Spatio-Temporal Point Processes [arxiv] Ricky T. Q. Chen, Brandon Amos, Maximilian Nickel Abstract. We propose a new class of parameterizations

Facebook Research 75 Dec 19, 2022
MPRNet-Cloud-removal: Progressive cloud removal

MPRNet-Cloud-removal Progressive cloud removal Requirements 1.Pytorch = 1.0 2.Python 3 3.NVIDIA GPU + CUDA 9.0 4.Tensorboard Installation 1.Clone the

Semi 95 Dec 18, 2022
Raptor-Multi-Tool - Raptor Multi Tool With Python

Promises 🔥 20 Stars and I'll fix every error that there is 50 Stars and we will

Aran 44 Jan 04, 2023
ECAENet (TensorFlow and Keras)

ECAENet: EfficientNet with Efficient Channel Attention for Plant Species Recognition (SCI:Q3) (Journal of Intelligent & Fuzzy Systems)

4 Dec 22, 2022
An open source object detection toolbox based on PyTorch

MMDetection is an open source object detection toolbox based on PyTorch. It is a part of the OpenMMLab project.

Bo Chen 24 Dec 28, 2022
Human annotated noisy labels for CIFAR-10 and CIFAR-100.

Dataloader for CIFAR-N CIFAR-10N noise_label = torch.load('./data/CIFAR-10_human.pt') clean_label = noise_label['clean_label'] worst_label = noise_lab

<a href=[email protected]"> 117 Nov 30, 2022
Vehicle detection using machine learning and computer vision techniques for Udacity's Self-Driving Car Engineer Nanodegree.

Vehicle Detection Video demo Overview Vehicle detection using these machine learning and computer vision techniques. Linear SVM HOG(Histogram of Orien

hata 1.1k Dec 18, 2022
Grammar Induction using a Template Tree Approach

Gitta Gitta ("Grammar Induction using a Template Tree Approach") is a method for inducing context-free grammars. It performs particularly well on data

Thomas Winters 36 Nov 15, 2022
This repository contains code, network definitions and pre-trained models for working on remote sensing images using deep learning

Deep learning for Earth Observation This repository contains code, network definitions and pre-trained models for working on remote sensing images usi

Nicolas Audebert 447 Jan 05, 2023