You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[2022-12-07] Upload script of user control. Please see user_specify_demo.py
[2022-12-07] Upload inference code of video style transfer. Please see inference_frame.py. Please download checkpoints from here and extract the package to the main directory of this repo before running.
Prerequisites
Linux or macOS
Python 3
PyTorch 1.7+ and other dependencies (torchvision, visdom, dominate, and other common python libs)
Getting Started
Clone this repository:
git clone https://github.com/Huage001/AdaAttN
cd AdaAttN
Inference:
Make a directory for checkpoints if there is not:
mkdir checkpoints
Download pretrained model from Google Drive, move it to checkpoints directory, and unzip:
Configure content_path and style_path in test_adaattn.sh firstly, indicating paths to folders of testing content images and testing style images respectively.
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:
python -m visdom.server
Then, simply run:
bash train_adaattn.sh
You can monitor training status at https://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
This implementation is developed based on the code framework of pytorch-CycleGAN-and-pix2pix by Junyan Zhu et al.
About
Officially unofficial PyTorch re-implementation of paper: AdaAttN: Revisit Attention Mechanism in Arbitrary Neural Style Transfer, ICCV 2021.