We propose a new test-time adaptation setup that is more suitable for real-world applications, namely practical test-time adaptation (PTTA). PTTA considers both distribution changing and correlation sampling. Meanwhile, we propose a robust test-time adaptation (RoTTA) method, which has a more comprehensive consideration of the challenges of PTTA.
Step by Step installation,
conda create -n rotta python=3.9.0
conda activate rotta
# this installs the right pip and dependencies for the fresh python
conda install -y ipython pip
# this installs required packages
pip install -r requirements.txt
Download CIFAR-10-C and CIFAR-100-C. (Running the code directly also works, since it automatically downloads the data set at the first running, but it's too slow to tolerate and has high requirements on internet stability)
Symlink dataset by
ln -s path_to_cifar10_c datasets/CIFAR-10-C
ln -s path_to_cifar100_c datasets/CIFAR-100-C
Run RoTTA by
python ptta.py \
-acfg configs/adapter/rotta.yaml \
-dcfg configs/dataset/cifar10.yaml \
OUTPUT_DIR RoTTA/cifar10
python ptta.py \
-acfg configs/adapter/rotta.yaml \
-dcfg configs/dataset/cifar100.yaml \
OUTPUT_DIR RoTTA/cifar100
This project is based on the following open-source projects:
We thank their authors for making the source code publicly available.
If you find this project useful in your research, please consider citing:
@inproceedings{yuan2023robust,
title={Robust test-time adaptation in dynamic scenarios},
author={Yuan, Longhui and Xie, Binhui and Li, Shuang},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={15922--15932},
year={2023}
}
If you have any problem with our code, feel free to contact
or describe your problem in Issues.