All Projects → sunshineatnoon → Linearstyletransfer

sunshineatnoon / Linearstyletransfer

Licence: bsd-2-clause
This is the Pytorch implementation of "Learning Linear Transformations for Fast Image and Video Style Transfer" (CVPR 2019).

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Linearstyletransfer

tf-adain
TensorFlow implementation of the paper "Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization" by Xun Huang and Serge Belongie
Stars: ✭ 61 (-77.41%)
Mutual labels:  style-transfer
depth-preserving-neural-style-transfer
Depth-Preserving Style Transfer
Stars: ✭ 86 (-68.15%)
Mutual labels:  style-transfer
neural-style-pytorch
Neural Style implementation in PyTorch! 🎨
Stars: ✭ 50 (-81.48%)
Mutual labels:  style-transfer
CariMe-pytorch
Unpaired Caricature Generation with Multiple Exaggerations (TMM 2021)
Stars: ✭ 33 (-87.78%)
Mutual labels:  style-transfer
pytorch-neural-style-transfer-johnson
Reconstruction of the fast neural style transfer (Johnson et al.). Some portions of the paper have been improved by the follow-up work like the instance normalization, etc. Checkout transformer_net.py's header for details.
Stars: ✭ 85 (-68.52%)
Mutual labels:  style-transfer
fast-style-transfer-tutorial-pytorch
Simple Tutorials & Code Implementation of fast-style-transfer(Perceptual Losses for Real-Time Style Transfer and Super-Resolution, 2016 ECCV) using PyTorch.
Stars: ✭ 18 (-93.33%)
Mutual labels:  style-transfer
CoMoGAN
CoMoGAN: continuous model-guided image-to-image translation. CVPR 2021 oral.
Stars: ✭ 139 (-48.52%)
Mutual labels:  style-transfer
automated-deep-photo-style-transfer
TensorFlow implementation for the paper "Automated Deep Photo Style Transfer"
Stars: ✭ 92 (-65.93%)
Mutual labels:  style-transfer
Point-Then-Operate
Code for the ACL 2019 paper ``A Hierarchical Reinforced Sequence Operation Method for Unsupervised Text Style Transfer``
Stars: ✭ 44 (-83.7%)
Mutual labels:  style-transfer
deepai-js-client
Simple Javascript Client Library for Browser and Node.js for calling DeepAI's APIs
Stars: ✭ 22 (-91.85%)
Mutual labels:  style-transfer
TET-GAN
[AAAI 2019] TET-GAN: Text Effects Transfer via Stylization and Destylization
Stars: ✭ 74 (-72.59%)
Mutual labels:  style-transfer
Splice
Official Pytorch Implementation for "Splicing ViT Features for Semantic Appearance Transfer" presenting "Splice" (CVPR 2022)
Stars: ✭ 126 (-53.33%)
Mutual labels:  style-transfer
Awesome Neural Style
A curated list of neural style and deep neural network visualization
Stars: ✭ 16 (-94.07%)
Mutual labels:  style-transfer
CNTKUnityTools
Some Deep learning tools in Unity using CNTK
Stars: ✭ 21 (-92.22%)
Mutual labels:  style-transfer
HistoGAN
Reference code for the paper HistoGAN: Controlling Colors of GAN-Generated and Real Images via Color Histograms (CVPR 2021).
Stars: ✭ 158 (-41.48%)
Mutual labels:  style-transfer
neural style synthesizer
No description or website provided.
Stars: ✭ 15 (-94.44%)
Mutual labels:  style-transfer
Text-Effects-Transfer
Matlab implementation of the paper "Awesome Typography: Statistics-Based Text Effects Transfer"
Stars: ✭ 40 (-85.19%)
Mutual labels:  style-transfer
Neural Style Tf
TensorFlow (Python API) implementation of Neural Style
Stars: ✭ 2,943 (+990%)
Mutual labels:  style-transfer
Neural-Zoom-Legacy
Infinite Zoom For Style Transfer
Stars: ✭ 14 (-94.81%)
Mutual labels:  style-transfer
PyTorch-deep-photo-styletransfer
PyTorch implementation of "Deep Photo Style Transfer": https://arxiv.org/abs/1703.07511
Stars: ✭ 23 (-91.48%)
Mutual labels:  style-transfer

Learning Linear Transformations for Fast Image and Video Style Transfer

[Paper] [Project Page]

Prerequisites

All code tested on Ubuntu 16.04, pytorch 0.4.1, and opencv 3.4.2

Style Transfer

  • Clone from github: git clone https://github.com/sunshineatnoon/LinearStyleTransfer
  • Download pre-trained models from google drive.
  • Uncompress to root folder :
cd LinearStyleTransfer
unzip models.zip
rm models.zip

Artistic style transfer

python TestArtistic.py

or conduct style transfer on relu_31 features

python TestArtistic.py --vgg_dir models/vgg_r31.pth --decoder_dir models/dec_r31.pth --matrixPath models/r31.pth --layer r31

Photo-realistic style transfer

For photo-realistic style transfer, we need first compile the pytorch_spn repository.

cd libs/pytorch_spn
sh make.sh
cd ../..

Then:

python TestPhotoReal.py

Note: images with _filtered.png as postfix are images filtered by the SPN after style transfer, images with _smooth.png as postfix are images post process by a smooth filter.

Video style transfer

python TestVideo.py

Real-time video demo

python real-time-demo.py --vgg_dir models/vgg_r31.pth --decoder_dir models/dec_r31.pth --matrixPath models/r31.pth --layer r31

Model Training

Data Preparation

  • MSCOCO
wget http://msvocds.blob.core.windows.net/coco2014/train2014.zip
  • WikiArt
    • Either manually download from kaggle.
    • Or install kaggle-cli and download by running:
    kg download -u <username> -p <password> -c painter-by-numbers -f train.zip
    

Training

Train a style transfer model

To train a model that transfers relu4_1 features, run:

python Train.py --vgg_dir models/vgg_r41.pth --decoder_dir models/dec_r41.pth --layer r41 --contentPath PATH_TO_MSCOCO --stylePath PATH_TO_WikiArt --outf OUTPUT_DIR

or train a model that transfers relu3_1 features:

python Train.py --vgg_dir models/vgg_r31.pth --decoder_dir models/dec_r31.pth --layer r31 --contentPath PATH_TO_MSCOCO --stylePath PATH_TO_WikiArt --outf OUTPUT_DIR

Key hyper-parameters:

  • style_layers: which features to compute style loss.
  • style_weight: larger style weight leads to heavier style in transferred images.

Intermediate results and weight will be stored in OUTPUT_DIR

Train a SPN model to cancel distortions for photo-realistic style transfer

Run:

python TrainSPN.py --contentPath PATH_TO_MSCOCO

Acknowledgement

Citation

@inproceedings{li2018learning,
    author = {Li, Xueting and Liu, Sifei and Kautz, Jan and Yang, Ming-Hsuan},
    title = {Learning Linear Transformations for Fast Arbitrary Style Transfer},
    booktitle = {IEEE Conference on Computer Vision and Pattern Recognition},
    year = {2019}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].