JialeCao001 / PSTR

PSTR: End-to-End One-Step Person Search With Transformers (CVPR2022)
https://arxiv.org/abs/2204.03340
Apache License 2.0
43 stars 12 forks source link
end-to-end-detection person-search transformer

PSTR (CVPR2022)

Installation

Create a new conda enviroment for PSTR

conda create -n pstr python=3.7 -y conda activate pstr pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge

Comiple mmcv, which has been included in this project

cd PSTR/mmcv MMCV_WITH_OPS=1 pip install -e .

Comiple this project

cd PSTR pip install -r requirements/build.txt pip install -v -e . # or "python setup.py develop" pip install sklearn


- If you have the problem ```local variable 'beta1' referenced before assignment``` with PyTorch1.8, add one table space in L110 of [```optim/adamw.py```](https://github.com/pytorch/pytorch/issues/55740)

## Train and Inference

#####  Datasets and Annotations

- Download [PRW](https://github.com/liangzheng06/PRW-baseline) and [CUHK-SYSU](https://github.com/ShuangLI59/person_search) datasets.
- Download the [json annotations](https://drive.google.com/file/d/1J2YAU7n954TiSwqopJCWdK25IaF6Mb9_/view?usp=sharing) provided by [AlignPS](https://github.com/daodaofr/AlignPS).

#####  Train with a single GPU
```shell
python tools/train.py ${CONFIG_FILE} --no-validate
Test with a single GPU
PRW: sh run_test_prw.sh 
CUHK: sh run_test_cuhk.sh  

Results

We provide some models with different backbones and results on PRW and CUHK-SYSU datasets, which have a little difference to CVPR version due to jitter.

name dataset backbone mAP top-1 mAP+ top-1+ download
PSTR PRW PVTv2-B2 57.46 90.57 58.07 92.03 model
PSTR PRW ResNet50 50.03 88.04 50.64 89.94 model
PSTR PRW ResNet50-DCN 51.09 88.33 51.62 90.13 model
PSTR CUHK-SYSU PVTv2-B2 95.31 96.28 95.78 96.83 model
PSTR CUHK-SYSU ResNet50 93.55 94.93 94.16 95.48 model
PSTR CUHK-SYSU ResNet50-DCN 94.22 95.28 94.90 95.97 model

Citation

If the project helps your research, please cite this paper.

@article{Cao_PSTR_CVPR_2022,
  author =       {Jiale Cao and Yanwei Pang and Rao Muhammad Anwer and Hisham Cholakkal and Jin Xie and Mubarak Shah and Fahad Shahbaz Khan},
  title =        {PSTR: End-to-End One-Step Person Search With Transformers},
  journal =      {Proc. IEEE Conference on Computer Vision and Pattern Recognition},
  year =         {2022}
}

Acknowledgement

Many thanks to the open source codes: mmdetection, AlignPS, and SeqNet.