/DRT

Primary LanguagePythonOtherNOASSERTION

Dynamic Transfer for Multi-Source Domain Adaptation (CVPR 2021)

A pytorch implementation of DRT. If you use this code in your research please consider citing

@article{li2021dynamic, title={Dynamic Transfer for Multi-Source Domain Adaptation}, author={Li, Yunsheng and Yuan, Lu and Chen, Yinpeng and Wang, Pei and Vasconcelos, Nuno}, journal={arXiv preprint arXiv:2103.10583}, year={2021} }

Requirements

  • Hardware: PC with Tesla-V100.
  • Software: CUDA >= 10.0, Anaconda3, pytorch >= 1.0.0

Download Dataset

Please merge the dataset and the label into the same folder

Evaluate DRT

The pre-trained models are provided- Clipart, Infograph, Painting, Quickdraw, Real, Sketch. Here we use 'Clipart' as an example. If you want to test other domains, all you need to do is just to replace the name of the dataset.

python drt.py --batch-size 64 --num-layer 2 --save /path/to/output --src_path clipart_comb.txt --trg_path clipart_train.txt --val_path clipart_test.txt --root /path/to/dataset --weight /paht/to/clipart.tar.pth --evaluate

Train DRT

Please download the ImageNet pre-trained dynamic model. Again we use 'Clipart' as an example. For training DRT with other domains, you can use other scripts in the folder DRT/script.

sh clipart_train.sh /path/to/output /path/to/dataset /path/to/resnet_dy_pretrained.pth