UATTA

July 22, 2026 · View on GitHub

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.

ResourceOfficial linkNotes
UATTA paperhttps://arxiv.org/abs/2604.08598Our paper page.
IRRA/HAM checkpointhttps://github.com/sssaury/HAMHAM project/checkpoint entry.
CLIP tokenizer vocabularyhttps://github.com/openai/CLIP/blob/main/clip/bpe_simple_vocab_16e6.txt.gzRequired by IRRA_UATTA/utils/simple_tokenizer.py.
CUHK-PEDEShttp://xiaotong.me/static/projects/person-search-language/dataset.htmlOfficial project page.
ICFG-PEDEShttps://github.com/zifyloo/SSANOfficial dataset/code entry.
RSTPReidhttps://github.com/NjtechCVLab/RSTPReid-DatasetOfficial dataset repository.
CMP/X-VLM checkpointhttps://github.com/Shuyu-XJTU/CMPCMP/PAB official repository.
PAB datasethttps://github.com/Shuyu-XJTU/CMPPAB 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.

DatasetSourceEpochRank@1Rank@5Rank@10mAPmINP
CUHK-PEDESPaper/retained SOTA970.92386.89191.86263.50347.209
CUHK-PEDESLatest reproduction970.80986.90791.86263.46947.192
ICFG-PEDESPaper/retained SOTA962.15277.31882.95036.1105.934
ICFG-PEDESLatest reproduction962.00677.23282.78435.9235.821
RSTPReidPaper/retained SOTA4961.85081.05088.40046.30422.276
RSTPReidLatest reproduction4961.95081.20088.30046.27422.157
PABPaper/retained SOTA4976.13898.02899.09086.14586.145
PABLatest reproduction4975.78498.02898.98986.00186.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