• Stars
    star
    206
  • Rank 190,504 (Top 4 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Officially unofficial PyTorch re-implementation of paper: AdaAttN: Revisit Attention Mechanism in Arbitrary Neural Style Transfer, ICCV 2021.

AdaAttN: Revisit Attention Mechanism in Arbitrary Neural Style Transfer

[Paper] [PyTorch Implementation] [Paddle Implementation]

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 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:

        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:

        bash test_adaattn.sh
      • Check 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.server
      • Then, simply run:

        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

More Repositories

1

PaintTransformer

Officially unofficial re-implementation of paper: Paint Transformer: Feed Forward Neural Painting with Stroke Prediction, ICCV 2021.
Python
488
star
2

LinFusion

Official PyTorch and Diffusers Implementation of "LinFusion: 1 GPU, 1 Minute, 16K Image"
Python
204
star
3

Transfer-Any-Style

An interactive demo based on Segment-Anything for style transfer which enables different content regions apply different styles.
Python
95
star
4

DatasetFactorization

PyTorch implementation of paper "Dataset Distillation via Factorization" in NeurIPS 2022.
Python
61
star
5

DynaST

Pytorch implementation of paper "DynaST: Dynamic Sparse Transformer for Exemplar-Guided Image Generation", ECCV 2022.
Python
53
star
6

Paint-Anything

An interactive demo based on Segment-Anything for stroke-based painting which enables human-like painting.
Python
34
star
7

Artistic-Video-Partial-Conv-Depth-Loss

This is pytorch implementation of paper Stable Video Style Transfer Based on Partial Convolution with Depth-Aware Supervision.
Python
12
star
8

StyDeSty

PyTorch implementation of paper "StyDeSty: Min-Max Stylization and Destylization for Single Domain Generalization" in ICML 2024.
Python
11
star
9

Graph-Based-Circuit-Painter

Source Code of Paper Graph-Based Locality-Sensitive Circuit Sketch Recognition
Java
6
star
10

Improving-Reliability-for-Federated-Learning-in-Mobile-Edge-Networks

Shell
3
star
11

CircuitPainter

Circuit painter and recognizer based on handwriting, painting with MFC, recognizing with CNN based on tensorflow.
C++
1
star
12

NJU_OSlab5

ζ–‡δ»Άη³»η»Ÿ
C
1
star