README.md

November 11, 2022 · View on GitHub

PFD:Pose-guided Feature Disentangling for Occluded Person Re-identification based on Transformer

Python >=3.6 PyTorch >=1.6

This repo is the official implementation of "Pose-guided Feature Disentangling for Occluded Person Re-identification based on Transformer(PFD), Tao Wang, Hong Liu, Pinhao Song, Tianyu Guo& Wei Shi" in PyTorch.PFD-Net

Pipeline

framework

Dependencies

  • timm==0.3.2

  • torch==1.6.0

  • numpy==1.20.2

  • yacs==0.1.8

  • opencv_python==4.5.2.54

  • torchvision==0.7.0

  • Pillow==8.4.0

Installation

pip install -r requirements.txt

If you find some packages are missing, please install them manually.

Prepare Datasets

mkdir data

Please download the dataset, and then rename and unzip them under the data

data
|--market1501
|
|--Occluded_Duke
|
|--Occluded_REID
|
|--MSMT17
|
|--dukemtmcreid

Prepare ViT Pre-trained and HRNet Pre-trained Models

mkdir data

The ViT Pre-trained model can be found in ViT_Base, The HRNet Pre-trained model can be found in HRNet, please download it and put in the './weights' dictory.

Training

We use One GeForce GTX 1080Ti GPU for Training Before train the model, please modify the parameters in config file, please refer to Arguments in TransReID

python occ_train.py --config_file {config_file path}
#examples
1. For Occluded-Duke:
python occ_train.py --config_file 'configs/OCC_Duke/skeleton_pfd.yml'
2. For Market-1501:
python occ_train.py --config_file 'configs/market1501/skeleton_pfd.yml'
3. For DUKEMTMC:
python occ_train.py --config_file 'configs/dukemtmcreid/skeleton_pfd.yml'
......

Test the model

First download the Occluded-Duke model:Occluded-Duke

To test on pretrained model on Occ-Duke: Modify the pre-trained model path (PRETRAIN_PATH:ViT_Base, POSE_WEIGHT:HRNet, WEIGHT:Occluded-Duke) in yml, and then run:

## OccDuke for example
python test.py --config_file 'configs/OCC_Duke/skeleton_pfd.yml'

Occluded-Duke Results

ModelImage SizeRank-1mAP
HOReID256*12855.143.8
PAT256*12864.553.6
TransReID256*12864.255.7
PFD256*12867.760.1
TransReID*256*12866.459.2
PFD*256*12869.561.8

*means the encoder is with a small step sliding-window setting

Occluded-REID Results

ModelImage SizeRank-1mAP
HOReID256*12880.370.2
PAT256*12881.672.1
PFD256*12879.881.3

Market-1501 Results

ModelImage SizeRank-1mAP
HOReID256*12880.370.2
PAT256*12895.488.0
TransReID256*12895.488.0
PFD256*12895.589.6

DukeMTMC Results

ModelImage SizeRank-1mAP
HOReID256*12886.975.6
PAT256*12888.878.2
TransReID256*12889.680.6
PFD256*12890.682.2
TransReID*256*12890.782.0
PFD*256*12891.283.2

Citation

If you find our work useful in your research, please consider citing this paper! (preprint version will be available soon)

Arxiv:

@misc{wang2021poseguided,
      title={Pose-guided Feature Disentangling for Occluded Person Re-identification Based on Transformer}, 
      author={Tao Wang and Hong Liu and Pinhao Song and Tianyu Guo and Wei Shi},
      year={2021},
      eprint={2112.02466},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

AAAI:

@inproceedings{wang2022pose,
  title={Pose-guided feature disentangling for occluded person re-identification based on transformer},
  author={Wang, Tao and Liu, Hong and Song, Pinhao and Guo, Tianyu and Shi, Wei},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  volume={36},
  number={3},
  pages={2540--2549},
  year={2022}
}

Acknowledgement

Our code is extended from the following repositories. We thank the authors for releasing the codes.

License

This project is licensed under the terms of the MIT license.