All Projects → MAlberts99 → PyTorch-AdaIN-StyleTransfer

MAlberts99 / PyTorch-AdaIN-StyleTransfer

Licence: MIT license
This project is an unofficial implementation of the paper: Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to PyTorch-AdaIN-StyleTransfer

transformer generalization
The official repository for our paper "The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformers". We significantly improve the systematic generalization of transformer models on a variety of datasets using simple tricks and careful considerations.
Stars: ✭ 58 (+107.14%)
Mutual labels:  paper
flPapers
Paper collection of federated learning. Conferences and Journals Collection for Federated Learning from 2019 to 2021, Accepted Papers, Hot topics and good research groups. Paper summary
Stars: ✭ 76 (+171.43%)
Mutual labels:  paper
DeepCAD
code for our ICCV 2021 paper "DeepCAD: A Deep Generative Network for Computer-Aided Design Models"
Stars: ✭ 74 (+164.29%)
Mutual labels:  paper
SRmeetsPS-CUDA
CUDA implementation of the paper "Depth Super-Resolution Meets Uncalibrated Photometric Stereo"
Stars: ✭ 28 (+0%)
Mutual labels:  paper
FastAsyncVoxelSniper
Voxel Sniper fork for modern Minecraft versions utilizing the improvements of FastAsyncWorldEdit
Stars: ✭ 38 (+35.71%)
Mutual labels:  paper
NotQuests
Flexible, open & solid paper Quest Plugin [with GUI]
Stars: ✭ 32 (+14.29%)
Mutual labels:  paper
SGCP
TACL 2020: Syntax-Guided Controlled Generation of Paraphrases
Stars: ✭ 67 (+139.29%)
Mutual labels:  paper
FieldedSDM
Fielded Sequential Dependence Model (code and runs)
Stars: ✭ 32 (+14.29%)
Mutual labels:  paper
is-cv
Image Segmentation Enhancements and Optimizations: A Stochastic Approach
Stars: ✭ 21 (-25%)
Mutual labels:  paper
deeplearning-paper-notes
Reading notes on deep learning papers---深度学习论文阅读笔记
Stars: ✭ 36 (+28.57%)
Mutual labels:  paper
lshensemble
LSH index for approximate set containment search
Stars: ✭ 48 (+71.43%)
Mutual labels:  paper
Paper-Archive
A collection of paper summaries from a wide range of topics related to Machine Learning
Stars: ✭ 26 (-7.14%)
Mutual labels:  paper
SkyWarsReloaded
The most popular Skywars plugin ever built for Spigot and Bukkit!
Stars: ✭ 34 (+21.43%)
Mutual labels:  paper
cv-arxiv-daily
🎓Automatically Update CV Papers Daily using Github Actions (Update Every 12th hours)
Stars: ✭ 216 (+671.43%)
Mutual labels:  paper
EagerMOT
Official code for "EagerMOT: 3D Multi-Object Tracking via Sensor Fusion" [ICRA 2021]
Stars: ✭ 249 (+789.29%)
Mutual labels:  paper
efficient-attention
An implementation of the efficient attention module.
Stars: ✭ 191 (+582.14%)
Mutual labels:  paper
Neural-Architecture-Search
This repo is about NAS
Stars: ✭ 26 (-7.14%)
Mutual labels:  paper
cerberus research
Research tools for analysing Cerberus banking trojan.
Stars: ✭ 110 (+292.86%)
Mutual labels:  paper
paper-terminal
Print Markdown to a paper in your terminal
Stars: ✭ 33 (+17.86%)
Mutual labels:  paper
ot-gan
Code for the paper "Improving GANs Using Optimal Transport"
Stars: ✭ 53 (+89.29%)
Mutual labels:  paper

PyTorch-AdaIN-StyleTransfer

This project is an unofficial PyTorch implementation of the paper using Google Colab: Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization

All credit goes to: Xun Huang and Serge Belongie

Description

The paper presents a new style transfer algorithm, which uses a fixed pretrained vgg19 (up to ReLU 4.1) to encode a style image and a content image. Then the style of the style image is transferred to the content image. The novel approach this paper describes uses an AdaIN layer to transfer the style. This layer first normalises the the content image to unit mean and standard deviation. After that, the content image is scaled such that it's mean and standard deviation are equal to the mean and standard deviation of the style image. Then the image is decoded using a decoder that mirrors the vgg19.

Requirements

  • A google drive account to run the notebooks.
  • A pretrained vgg19 pth file. I used the file provided by Naoto Inoue in his implementation of the same paper. Link: vgg_normalised.pth.

To train:

A note on the Datasets: The free version of Google Colab only has 30GB of usable storage while using the GPU. Thus you may have to reduce the size of the dataset. In this implementation I used 40k images of each dataset.

Trained Model

You can download my model from here. It has been trained for 120.000 iteration and provides an image quality close to the offical implementation. The style weight (gamma) used was 2.0.

Manual

  • Copy the content of this repository into a Google Drive folder. Then download the pretrained vgg19 file and place it in the same folder. If you want to play around with the network add the pretrained network file as well. If you want to train the network from scratch, e.g change the style weight, download the datasets as well.

Interference

  • Open the Style Transfer Test notebook. In the first cell you need to specify the directory of the folder in your Google Drive. Additionally if you changed the image folder you also need to change the img_dir variable accordingly.
  • The next cell will load the network.
  • Then the images are loaded. Here you can choose your images.
  • In the next cell you can change the alpha variable. This variable influences the impact of the style image on the content image.

Training

  • Open the Style Transfer Train notebook. In the first cell you need to specify the directory of the folder in your Google Drive.
  • Then you will have to download/import the datasets into the colab instance. I have not implemented this step as depending on your storage you will need to reduce the amount of images of each dataset used.
  • Change the pathStyleImages and pathContentImages to the folders containing the images. Note the folder needs to only contain images. Nested folders are not supported
  • Then run the rest of the cells.

Results

Style Generated Image

As can be seen above the results are not quite as good as the one presented in the paper. This can be explained by the model in the paper being trained for 160.000 iterations. I only trained mine for 120.000. Additionally, the original model was trained on 80.000 images of each type in whereas I only trained on 40.000 images.

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].