/PMTrans

Primary LanguagePython

PMTrans

Patch-Mix Transformer for Unsupervised Domain Adaptation: A Game Perspective

CVPR 2023 Highlight

There are some typos in results on the DomainNet dataset. And we revise these typos in the newest version. Please check it.

This is a rough version, I will continue to polish it.

Pretrained Swin-B

Install

  • Create a conda virtual environment and activate it:
conda create -n swin python=3.7 -y
conda activate swin
conda install pytorch==1.7.1 torchvision==0.8.2 cudatoolkit=10.1 -c pytorch
  • Install timm==0.3.2:
pip install timm==0.3.2
pip install tensorboard 
  • Install Apex:
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir ./
https://github.com/NVIDIA/apex/issues/1227
  • Install other requirements:
pip install opencv-python==4.4.0.46 termcolor==1.1.0 yacs==0.1.8

Datasets:

  • Download the Office31, Office Home, VisDA and Domainnet Make a file recording the path and label of image like txt files in datasets/office_home/
 $ tree data
 datasets
 ├── ofice_home
 │   ├── Art.txt
 │   ├── Clipart.txt
 │   ├── Product.txt
 │   ├── Real_World.txt
 └── ...

Training:

bash dist_train.sh