PyTorch implementations of the paper: "Learning Independent Instance Maps for Crowd Localization"

Overview

IIM - Crowd Localization


This repo is the official implementation of paper: Learning Independent Instance Maps for Crowd Localization. The code is developed based on C3F. framework

Progress

  • Testing Code (2020.12.10)
  • Training Code
    • NWPU (2020.12.14)
    • JHU (2021.01.05)
    • UCF-QNRF (2020.12.30)
    • ShanghaiTech Part A/B (2020.12.29)
    • FDST (2020.12.30)
  • scale information for UCF-QNRF and ShanghaiTech Part A/B (2021.01.07)

Getting Started

Preparation

  • Prerequisites

    • Python 3.7
    • Pytorch 1.6: http://pytorch.org .
    • other libs in requirements.txt, run pip install -r requirements.txt.
  • Code

  • Datasets

    • Download NWPU-Crowd dataset from this link.

    • Unzip *zip files in turns and place images_part* into the same folder (Root/ProcessedData/NWPU/images).

    • Download the processing labels and val gt file from this link. Place them into Root/ProcessedData/NWPU/masks and Root/ProcessedData/NWPU, respectively.

    • If you want to reproduce the results on Shanghai Tech Part A/B , UCF-QNRF, and JHU datasets, you can follow the instructions in DATA.md to setup the datasets.

    • Finally, the folder tree is below:

   -- ProcessedData
   	|-- NWPU
   		|-- images
   		|   |-- 0001.jpg
   		|   |-- 0002.jpg
   		|   |-- ...
   		|   |-- 5109.jpg
   		|-- masks
   		|   |-- 0001.png
   		|   |-- 0002.png
   		|   |-- ...
   		|   |-- 3609.png
   		|-- train.txt
   		|-- val.txt
   		|-- test.txt
   		|-- val_gt_loc.txt
   -- PretrainedModels
     |-- hrnetv2_w48_imagenet_pretrained.pth
   -- IIM
     |-- datasets
     |-- misc
     |-- ...

Training

  • run python train.py.
  • run tensorboard --logdir=exp --port=6006.
  • The validtion records are shown as follows: val_curve
  • The sub images are the input image, GT, prediction map,localization result, and pixel-level threshold, respectively: val_curve

Tips: The training process takes ~50 hours on NWPU datasets with two TITAN RTX (48GB Memeory).

Testing and Submitting

  • Modify some key parameters in test.py:
    • netName.
    • model_path.
  • Run python test.py. Then the output file (*_*_test.txt) will be generated, which can be directly submitted to CrowdBenchmark

Visualization on the val set

  • Modify some key parameters in test.py:
    • test_list = 'val.txt'
    • netName.
    • model_path.
  • Run python test.py. Then the output file (*_*_val.txt) will be generated.
  • Modify some key parameters in vis4val.py:
    • pred_file.
  • Run python vis4val.py.

Performance

The results (F1, Pre., Rec. under the sigma_l) and pre-trained models on NWPU val set, UCF-QNRF, SHT A, SHT B, and FDST:

Method NWPU val UCF-QNRF SHT A
Paper: VGG+FPN [2,3] 77.0/80.2/74.1 68.8/78.2/61.5 72.5/72.6/72.5
This Repo's Reproduction: VGG+FPN [2,3] 77.1/82.5/72.3 67.8/75.7/61.5 71.6/75.9/67.8
Paper: HRNet [1] 80.2/84.1/76.6 72.0/79.3/65.9 73.9/79.8/68.7
This Repo's Reproduction: HRNet [1] 79.8/83.4/76.5 72.0/78.7/66.4 76.1/79.1/73.3
Method SHT B FDST JHU
Paper: VGG+FPN [2,3] 80.2/84.9/76.0 93.1/92.7/93.5 -
This Repo's Reproduction: VGG+FPN [2,3] 81.7/88.5/75.9 93.9/94.7/93.1 61.8/73.2/53.5
Paper: HRNet [1] 86.2/90.7/82.1 95.5/95.3/95.8 62.5/74.0/54.2
This Repo's Reproduction: HRNet [1] 86.0/91.5/81.0 95.7/96.9 /94.4 64.0/73.3/56.8

References

  1. Deep High-Resolution Representation Learning for Visual Recognition, T-PAMI, 2019.
  2. Very Deep Convolutional Networks for Large-scale Image Recognition, arXiv, 2014.
  3. Feature Pyramid Networks for Object Detection, CVPR, 2017.

About the leaderboard on the test set, please visit Crowd benchmark. Our submissions are the IIM(HRNet) and IIM (VGG16).

Video Demo

We test the pretrained HR Net model on the NWPU dataset in a real-world subway scene. Please visit bilibili or YouTube to watch the video demonstration. val_curve

Citation

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

@article{gao2020learning,
  title={Learning Independent Instance Maps for Crowd Localization},
  author={Gao, Junyu and Han, Tao and Yuan, Yuan and Wang, Qi},
  journal={arXiv preprint arXiv:2012.04164},
  year={2020}
}

Our code borrows a lot from the C^3 Framework, and you may cite:

@article{gao2019c,
  title={C$^3$ Framework: An Open-source PyTorch Code for Crowd Counting},
  author={Gao, Junyu and Lin, Wei and Zhao, Bin and Wang, Dong and Gao, Chenyu and Wen, Jun},
  journal={arXiv preprint arXiv:1907.02724},
  year={2019}
}

If you use pre-trained models in this repo (HR Net, VGG, and FPN), please cite them.

Owner
tao han
tao han
SlideGraph+: Whole Slide Image Level Graphs to Predict HER2 Status in Breast Cancer

SlideGraph+: Whole Slide Image Level Graphs to Predict HER2 Status in Breast Cancer A novel graph neural network (GNN) based model (termed SlideGraph+

28 Dec 24, 2022
Good Classification Measures and How to Find Them

Good Classification Measures and How to Find Them This repository contains supplementary materials for the paper "Good Classification Measures and How

Yandex Research 7 Nov 13, 2022
ruptures: change point detection in Python

Welcome to ruptures ruptures is a Python library for off-line change point detection. This package provides methods for the analysis and segmentation

Charles T. 1.1k Jan 03, 2023
Stock-Prediction - prediction of stock market movements using sentiment analysis and deep learning.

Stock-Prediction- In this project, we aim to enhance the prediction of stock market movements using sentiment analysis and deep learning. We divide th

5 Jan 25, 2022
Hough Transform and Hough Line Transform Using OpenCV

Hough transform is a feature extraction method for detecting simple shapes such as circles, lines, etc in an image. Hough Transform and Hough Line Transform is implemented in OpenCV with two methods;

Happy N. Monday 3 Feb 15, 2022
A Comparative Review of Recent Kinect-Based Action Recognition Algorithms (TIP2020, Matlab codes)

A Comparative Review of Recent Kinect-Based Action Recognition Algorithms This repo contains: the HDG implementation (Matlab codes) for 'Analysis and

Lei Wang 5 Oct 22, 2022
Python scripts performing class agnostic object localization using the Object Localization Network model in ONNX.

ONNX Object Localization Network Python scripts performing class agnostic object localization using the Object Localization Network model in ONNX. Ori

Ibai Gorordo 15 Oct 14, 2022
Learning Representational Invariances for Data-Efficient Action Recognition

Learning Representational Invariances for Data-Efficient Action Recognition Official PyTorch implementation for Learning Representational Invariances

Virginia Tech Vision and Learning Lab 27 Nov 22, 2022
Unified unsupervised and semi-supervised domain adaptation network for cross-scenario face anti-spoofing, Pattern Recognition

USDAN The implementation of Unified unsupervised and semi-supervised domain adaptation network for cross-scenario face anti-spoofing, which is accepte

11 Nov 03, 2022
The Incredible PyTorch: a curated list of tutorials, papers, projects, communities and more relating to PyTorch.

This is a curated list of tutorials, projects, libraries, videos, papers, books and anything related to the incredible PyTorch. Feel free to make a pu

Ritchie Ng 9.2k Jan 02, 2023
CVPR 2021 - Official code repository for the paper: On Self-Contact and Human Pose.

selfcontact This repo is part of our project: On Self-Contact and Human Pose. [Project Page] [Paper] [MPI Project Page] It includes the main function

Lea Müller 68 Dec 06, 2022
Repository for benchmarking graph neural networks

Benchmarking Graph Neural Networks Updates Nov 2, 2020 Project based on DGL 0.4.2. See the relevant dependencies defined in the environment yml files

NTU Graph Deep Learning Lab 2k Jan 03, 2023
An implementation demo of the ICLR 2021 paper Neural Attention Distillation: Erasing Backdoor Triggers from Deep Neural Networks in PyTorch.

Neural Attention Distillation This is an implementation demo of the ICLR 2021 paper Neural Attention Distillation: Erasing Backdoor Triggers from Deep

Yige-Li 84 Jan 04, 2023
This is the winning solution of the Endocv-2021 grand challange.

Endocv2021-winner [Paper] This is the winning solution of the Endocv-2021 grand challange. Dependencies pytorch # tested with 1.7 and 1.8 torchvision

Vajira Thambawita 14 Dec 03, 2022
Unofficial implementation of Google "CutPaste: Self-Supervised Learning for Anomaly Detection and Localization" in PyTorch

CutPaste CutPaste: image from paper Unofficial implementation of Google's "CutPaste: Self-Supervised Learning for Anomaly Detection and Localization"

Lilit Yolyan 59 Nov 27, 2022
Simulations for Turring patterns on an apically expanding domain. T

Turing patterns on expanding domain Simulations for Turring patterns on an apically expanding domain. The details about the models and numerical imple

Yue Liu 0 Aug 03, 2021
[cvpr22] Perturbed and Strict Mean Teachers for Semi-supervised Semantic Segmentation

PS-MT [cvpr22] Perturbed and Strict Mean Teachers for Semi-supervised Semantic Segmentation by Yuyuan Liu, Yu Tian, Yuanhong Chen, Fengbei Liu, Vasile

Yuyuan Liu 132 Jan 03, 2023
TensorFlow implementation of ENet, trained on the Cityscapes dataset.

segmentation TensorFlow implementation of ENet (https://arxiv.org/pdf/1606.02147.pdf) based on the official Torch implementation (https://github.com/e

Fredrik Gustafsson 248 Dec 16, 2022
General purpose GPU compute framework for cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends)

General purpose GPU compute framework for cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled, asynchronous and optimized for advanced GPU data processing usec

The Kompute Project 1k Jan 06, 2023
Autoencoders pretraining using clustering

Autoencoders pretraining using clustering

IITiS PAN 2 Dec 16, 2021