This repository contains the officially unofficial PyTorch re-implementation of paper:
AdaAttN: Revisit Attention Mechanism in Arbitrary Neural Style Transfer,
Songhua Liu, Tianwei Lin, Dongliang He, Fu Li, Meiling Wang, Xin Li, Zhengxing Sun, Qian Li, Errui Ding
ICCV 2021

PyTorch 1.7+ and other dependencies (torchvision, visdom, dominate, and other common python libs)
Clone this repository:
shell
git clone https://github.com/Huage001/AdaAttN
cd AdaAttN
Inference:
shell
mkdir checkpoints
shell
mv [Download Directory]/AdaAttN_model.zip checkpoints/
unzip checkpoints/AdaAttN_model.zip
rm checkpoints/AdaAttN_model.zip
Configure content_path and style_path in test_adaattn.sh firstly, indicating paths to folders of testing content images and testing style images respectively.
Then, simply run:
shell
bash test_adaattn.sh
Train:
Download 'vgg_normalised.pth' from here.
Download COCO dataset and WikiArt dataset and then extract them.
Configure content_path, style_path, and image_encoder_path in train_adaattn.sh, indicating paths to folders of training content images, training style images, and 'vgg_normalised.pth' respectively.
Before training, start visdom server:
shell
python -m visdom.server
shell
bash train_adaattn.sh
You can monitor training status at http://localhost:8097/ and models would be saved at checkpoints/AdaAttN folder.
You may feel free to try other training options written in train_adaattn.sh.
## Citation
If you find ideas or codes useful for your research, please cite:
@inproceedings{liu2021adaattn,
title={AdaAttN: Revisit Attention Mechanism in Arbitrary Neural Style Transfer},
author={Liu, Songhua and Lin, Tianwei and He, Dongliang and Li, Fu and Wang, Meiling and Li, Xin and Sun, Zhengxing and Li, Qian and Ding, Errui},
booktitle={Proceedings of the IEEE International Conference on Computer Vision},
year={2021}
}
## Acknowledgments
$ claude mcp add AdaAttN \
-- python -m otcore.mcp_server <graph>