Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

UATTA

Official implementation for Pretrain-then-Adapt: Uncertainty-Aware Test-Time Adaptation for Text-based Person Search [SIGIR 2026].

This repository contains the SOTA reproduction code for the paper's Pretrain-then-Adapt experiments:

  • CLIP/IRRA-based UATTA on CUHK-PEDES, ICFG-PEDES, and RSTPReid.
  • X-VLM/CMP-based UATTA on PAB.

Requirements

Create an Anaconda environment and install the dependencies:

conda create -n uatta python=3.9 -y
conda activate uatta

# Install a PyTorch build matching your CUDA version.
pip install torch torchvision torchaudio

pip install -r requirements.txt

Data And Checkpoints

Please follow the upstream dataset/checkpoint pages for access instructions and license terms.

Resource Official link Notes
UATTA paper https://arxiv.org/abs/2604.08598 Our paper page.
IRRA/HAM checkpoint https://github.com/sssaury/HAM HAM project/checkpoint entry.
CLIP tokenizer vocabulary https://github.com/openai/CLIP/blob/main/clip/bpe_simple_vocab_16e6.txt.gz Required by IRRA_UATTA/utils/simple_tokenizer.py.
CUHK-PEDES http://xiaotong.me/static/projects/person-search-language/dataset.html Official project page.
ICFG-PEDES https://github.com/zifyloo/SSAN Official dataset/code entry.
RSTPReid https://github.com/NjtechCVLab/RSTPReid-Dataset Official dataset repository.
CMP/X-VLM checkpoint https://github.com/Shuyu-XJTU/CMP CMP/PAB official repository.
PAB dataset https://github.com/Shuyu-XJTU/CMP PAB dataset/code/checkpoint entry.

Arrange the IRRA-side files as follows:

IRRA_UATTA/
β”œβ”€β”€ data/
β”‚   └── bpe_simple_vocab_16e6.txt.gz
β”œβ”€β”€ checkpoints/
β”‚   └── HAM_checkpoint/
β”‚       └── random100w_2HAMcaptions/
β”‚           └── best0.pth
β”œβ”€β”€ input/
β”‚   └── images/
β”‚       β”œβ”€β”€ CUHK-PEDES/
β”‚       β”œβ”€β”€ ICFG-PEDES/
β”‚       └── RSTPReid/

Download the CLIP tokenizer vocabulary before running the IRRA-side experiments:

cd /path/to/OpenSource_Release
mkdir -p IRRA_UATTA/data
curl -L https://github.com/openai/CLIP/raw/main/clip/bpe_simple_vocab_16e6.txt.gz \
  -o IRRA_UATTA/data/bpe_simple_vocab_16e6.txt.gz

Arrange the CMP-side files as follows:

CMP_UATTA/
β”œβ”€β”€ checkpoint/
β”‚   β”œβ”€β”€ 16m_base_model_state_step_199999.th
β”‚   └── bert-base-uncased/
β”œβ”€β”€ data/
β”‚   └── PAB/
β”‚       β”œβ”€β”€ annotation/
β”‚       └── image/

SOTA Reproduction

Run each experiment separately after activating the uatta environment. The configs evaluate exactly the same epoch set as the retained SOTA logs.

CUHK-PEDES

cd /path/to/OpenSource_Release/IRRA_UATTA
CUDA_VISIBLE_DEVICES=0 python tta.py \
  --config_file tta_configs/ham_cuhk_tta/uatta_config.yaml \
  --seed 42 \
  --device cuda \
  --output_dir outputs/reproduce/cuhk_pedes \
  --eval_epochs 0,1,2,4,9,14,19 \
  > logs/cuhk_reproduce.log 2>&1

ICFG-PEDES

cd /path/to/OpenSource_Release/IRRA_UATTA
CUDA_VISIBLE_DEVICES=0 python tta.py \
  --config_file tta_configs/ham_icfg_tta/uatta_config.yaml \
  --seed 42 \
  --device cuda \
  --output_dir outputs/reproduce/icfg_pedes \
  --eval_epochs 0,1,2,4,9 \
  > logs/icfg_reproduce.log 2>&1

RSTPReid

cd /path/to/OpenSource_Release/IRRA_UATTA
CUDA_VISIBLE_DEVICES=0 python tta.py \
  --config_file tta_configs/ham_rstp_tta/uatta_config.yaml \
  --seed 42 \
  --device cuda \
  --output_dir outputs/reproduce/rstpreid \
  --eval_epochs 0,1,2,4,9,14,19,29,39,49,59 \
  > logs/rstp_reproduce.log 2>&1

PAB

cd /path/to/OpenSource_Release/CMP_UATTA
mkdir -p logs outputs/reproduce/pab
CUDA_VISIBLE_DEVICES=0 python tta.py \
  --config configs/uatta_config.yaml \
  --task pab_reproduce \
  --output_dir outputs/reproduce/pab \
  --checkpoint checkpoint/16m_base_model_state_step_199999.th \
  --seed 42 \
  --device cuda \
  --eval_epochs 0,1,2,4,9,14,19,29,39,49,59 \
  --tta \
  > logs/pab_reproduce.log 2>&1

Results

The original paper/retained SOTA metrics and the latest reproduced metrics are summarized below. Full adaptation traces are recorded in SOTA_Reproduction_Report.md.

Dataset Source Epoch Rank@1 Rank@5 Rank@10 mAP mINP
CUHK-PEDES Paper/retained SOTA 9 70.923 86.891 91.862 63.503 47.209
CUHK-PEDES Latest reproduction 9 70.809 86.907 91.862 63.469 47.192
ICFG-PEDES Paper/retained SOTA 9 62.152 77.318 82.950 36.110 5.934
ICFG-PEDES Latest reproduction 9 62.006 77.232 82.784 35.923 5.821
RSTPReid Paper/retained SOTA 49 61.850 81.050 88.400 46.304 22.276
RSTPReid Latest reproduction 49 61.950 81.200 88.300 46.274 22.157
PAB Paper/retained SOTA 49 76.138 98.028 99.090 86.145 86.145
PAB Latest reproduction 49 75.784 98.028 98.989 86.001 86.001

Small numeric differences are expected across hardware, CUDA, and PyTorch versions.

Acknowledgements

This release directly builds on code from:

See THIRD_PARTY_NOTICES.md for direct fork attribution.

We also thank the following repositories for methodological or implementation references:

Citation

@conference{zhang2026pretrain,
      title={Pretrain-then-Adapt: Uncertainty-Aware Test-Time Adaptation for Text-based Person Search},
      author={Jiahao Zhang and Shaofei Huang and Yaxiong Wang and Zhedong Zheng},
      year={2026},
      booktitle={SIGIR},
      doi={https://doi.org/10.1145/3805712.3809598},
      url={https://arxiv.org/abs/2604.08598},
}

Contact

For questions, please contact Jiahao Zhang at yc57963@um.edu.mo.

πŸ” Person Re-ID & Text-based Retrieval Ecosystem

Person re-ID Baseline (PyTorch)
A Tiny, Friendly & Strong PyTorch Baseline for Person / Vehicle Re-ID
with Hands-on Tutorial Β· The Community Standard since 2017


GitHub stars
3D Magic Mirror
Clothing Reconstruction from a Single Image
via a Causal Perspective Β· npj AI'26


GitHub stars
DG-Net
Joint Generation + Re-ID Learning
CVPR'19 Oral Β· NVIDIA


GitHub stars
Person re-ID GAN
GAN-based Augmentation (LSRO)
ICCV'17


GitHub stars
Language Person Search
Text-based Person Retrieval
Dual-Path Embedding


GitHub stars
APTM
Attribute Prompt Learning & Text Matching
MALS Benchmark (1.5M pairs) Β· ACM MM'23


GitHub stars
CMP
Text-based Person Anomaly Search
PAB Benchmark (1M pairs) Β· ICCV'25 Highlight


GitHub stars
UATTA
Uncertainty-Aware Test-Time Adaptation
for Text-based Person Search Β· SIGIR'26


GitHub stars
3D Person re-ID
Parameter-Efficient Re-ID
in the 3D Space (OG-Net)


GitHub stars
Pedestrian Alignment
Pedestrian Alignment Network (PAN)
for Robust Re-ID


GitHub stars

About

The official code of "Pretrain-then-Adapt: Uncertainty-Aware Test-Time Adaptation for Text-based Person Search" [SIGIR 2026]

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages