Official PyTorch implementation of the paper "PDF: Prompt-guided Decoupled Feature Learning for Cloth-Changing Person Re-identification".
# Create a conda environment
conda create -n pdf python=3.9 -y
conda activate pdf
# Install PyTorch and dependencies
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113 "numpy<2.0"
pip install yacs timm==0.5.4 scikit-image tqdm ftfy regex matplotlib h5pyDownload the cloth-changing ReID datasets into 'data' folder. The directory structure should look like this:
PDF/
└── data/
├── LTCC_ReID/
│ ├── train/
│ ├── test/
│ └── query/
├── prcc/
│ ├── rgb/
│ ├── val/
│ ├── test/
│ └── train/
├── last/
│ ├── train/
│ ├── val/
│ └── test/
└── VC-Clothes/
├── train/
├── query/
└── gallery/
Note: Please ensure the root path in your configuration files (
configs/*.yml) points to yourdata/folder.
We provide a convenient shell script to start the training process. This script handles the prompt-guided learning and feature decoupling.
To train the model on the specified dataset (e.g., LTCC), run:
# Run training
sh train.shYou can modify train.sh to switch between different datasets or hyper-parameters by changing the --config_file argument.
Our code is built upon CLIP-ReID. We thank the authors for their great work.