Huage001/AdaAttN
Huage001/AdaAttN has 249 GitHub stars and 34 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-25 13:48 UTC. Last push 2024-03-24.
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
关于
Officially unofficial PyTorch re-implementation of paper: AdaAttN: Revisit Attention Mechanism in Arbitrary Neural Style Transfer, ICCV 2021.
机器学习README.md
原文AdaAttN: Revisit Attention Mechanism in Arbitrary Neural Style Transfer
Overview
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

Updates
- [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 AdaAttNInference:
Make a directory for checkpoints if there is not:
mkdir checkpointsDownload pretrained model from Google Drive, move it to checkpoints directory, and unzip:
mv [Download Directory]/AdaAttN_model.zip checkpoints/ unzip checkpoints/AdaAttN_model.zip rm checkpoints/AdaAttN_model.zipConfigure 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:
bash test_adaattn.shCheck the results under results/AdaAttN folder.
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:
python -m visdom.serverThen, simply run:
bash train_adaattn.shYou 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
- This implementation is developed based on the code framework of pytorch-CycleGAN-and-pix2pix by Junyan Zhu et al.
探索相关项目
加载中…