This is a PyTorch implementation of our PRCV 2024 paper Adapting Vision-Language Models to Open Classes via Test-Time Prompt Tuning.
conda create -n ttpt -y python=3.9
conda activate ttpt
pip install -r requirements.txt
Please refer to https://github.com/KaiyangZhou/Dassl.pytorch#installation to install the Dassl.pytorch library.
Please refer to https://github.com/KaiyangZhou/CoOp/blob/main/DATASETS.md to prepare the datasets.
# zero-shot CLIP
bash run_zsclip.sh
# CoOp
bash run_coop.sh
# CoCoOp
bash run_cocoop.sh
# TTPT (Ours)
bash run_ttpt.sh
@article{gao2024adapting,
title={Adapting Vision-Language Models to Open Classes via Test-Time Prompt Tuning},
author={Zhengqing Gao and Xiang Ao and Xu-Yao Zhang and Cheng-Lin Liu},
journal={arXiv preprint arXiv:2408.16486},
year={2024}
}
Our implementation references the codes in the following repositories: