This repository contains the code for Long-tailed Test-time Adaptation of Vision-Language Models.
We test our codebase with PyTorch 2.1.1 with CUDA 12.1. Please install corresponding PyTorch and CUDA versions according to your computational resources. Then install the rest of required packages by running pip install -r requirements.txt. Please install the info-nce-pytorch package following info-nce-pytorch.
Please kindly refer to the installation guidelines in DATASET.md to install all required datasets.
Use the global find/replace function in your IDE to:
- Replace the
/PATH/TO/YOUR/CODEBASEwith the directory where you put this codebase. - Replace the
/PATH/TO/YOUR/PRETRAINwith the directory where you would like to save the pretrained models. - Replace the
/PATH/TO/YOUR/DATAwith the directory where you put the above datasets.
You can refer to run.sh and change all of the arguments. The definition of these arguments are:
| arguments | choices |
|---|---|
--datasets |
flowers102/caltech101/pets/cars/food101/aircraft/sun397/eurosat/ucf101/caltech101/A/R/V/S/I |
--backbone |
ViT_B/16,S,H,G |
--nview |
int, number of views |
--imb |
the reversed imbalance ratio. |
--ctype |
corruption type. |
--severity |
severity level of natural corruptions. 1-5. |
--noise |
severity of noise. |
If you find this codebase helpful, please cite:
@inproceedings{wanglong,
title={Long-tailed Test-Time Adaptation for Vision-Language Models},
author={Wang, Xucong and Zhao, Zhe and Wang, Zekun and Cao, Xiaofeng and Wang, Xu and Wu, Di and Wang, Pengkun and Wang, Yang},
booktitle={The Fourteenth International Conference on Learning Representations}
}
