Home

Awesome

STEERER for Object Counting and Localizaiotion (ICCV 2023)

Introduction

This is the official PyTorch implementation of paper: STEERER: Resolving Scale Variations for Counting and Localization via Selective Inheritance Learning, which effectively addressed the issue of scale variations for object counting and localizaioion, demonstrating the state-of-arts counting and localizaiton performance for different catagories, such as crowd,vehicle, crops and trees framework.

Catalog

Getting started

preparation

cd $root
git clone https://github.com/taohan10200/STEERER.git
conda create -n STEERER python=3.9 -y
conda activate STEERER
conda install pytorch==1.12.0 torchvision==0.13.0 cudatoolkit=11.3 -c pytorch
cd ${STEERER}
pip install -r requirements.txt

  $root/
  ├── ProcessedData
  │   ├── SHHB
  │   │   ├── images     # the input images
  │   │   ├── jsons      # the annotated labels
  │   │   ├── train.txt   # the image name of train set 
  │   │   ├── test.txt    # the image name of test set
  │   │   ├── test_gt_loc.txt  # the localization labels for evaluation
  │   │   └──train_gt_loc.txt  # the localization labels for train set (not used)
  │   ├── SHHA
  │   ├── NWPU
  │   ├── QNRF
  │   ├── JHU
  │   ├── MTC
  │   ├── JHU
  │   ├── JHUTRANCOS_v3
  │   └── TREE
  ├── PretrainedModels
  └── STEERER

Training

we provide simplify script to run distributed or cluster training,

# $1 is the configuration file, $2 is the GPU_ID
sh train.sh configs/SHHB_final.py 1  

# mltiple GPUs
sh train.sh configs/SHHB_final.py 0,1,2,3 

or if you are trainging on the computer cluster, you could be run

# $3 the configuration file, $4 is the number of GPUs
sh slurm_train.sh partition_name job_name configs/SHHB_final.py 1

Testing

To reproduce the performance, run the similry command like training,

# $1 is the configuration file, $2 is the checkpoint path, $3 is the GPU_ID, only support single GPU. 
sh test.sh configs/SHHB_final.py ../PretrainedModels/SHHB.pth 1

or if you are trainging on the computer cluster, you could be run

# $3 the configuration file,  $4 is the checkpoint path, $5 is the number of GPUs
sh slurm_test.sh partition_name job_name configs/SHHB_final.py ../PretrainedModels/SHHB.pth 1

Reproduce Counting and Localization Performance

DatasetMAE/MSEF1-m./Pre./Rec. (%)Pretraied ModelDataset
This RepoSHHB5.8/8.587.0/89.4/84.82.01weightsDataset
This RepoTRANSCOS1.8/3.195.1/91.7/93.4/weightsDataset
This RepoMTC2.74/3.72-weightsDataset
This RepoJHU54.5/240.665.6/66.7/64.6weightsDataset
This RepoTREE8.2/11.372.9/70.4/75.7weightsDataset
This RepoFDST0.93/1.2997.4/98.0/96.7weightsDataset
This RepoUCF-QNRF77.8/138.075.6/79.7/72.0weightsDataset
This RepoNWPU32.5/80.4 (Val. set)-weights-
<!-- # 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{haniccvsteerer,
  title={STEERER: Resolving Scale Variations for Counting and Localization via Selective Inheritance Learning},
  author={Han, Tao, Bai Lei, Liu Lingbo, and Ouyang  Wanli},
  booktitle={ICCV},
  year={2023}
}

Acknowledgement

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