All Projects → rrmina → neural-style-pytorch

rrmina / neural-style-pytorch

Licence: other
Neural Style implementation in PyTorch! 🎨

Programming Languages

Jupyter Notebook
11667 projects

Projects that are alternatives of or similar to neural-style-pytorch

Adain Style
Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization
Stars: ✭ 1,049 (+1998%)
Mutual labels:  style-transfer, neural-style
Style Transfer
A Keras Implementation of "A Neural Algorithm of Artistic Style"
Stars: ✭ 115 (+130%)
Mutual labels:  style-transfer, neural-style
Torch Models
Stars: ✭ 65 (+30%)
Mutual labels:  style-transfer, neural-style
Tensorflow Style Transfer
A simple, concise tensorflow implementation of style transfer (neural style)
Stars: ✭ 278 (+456%)
Mutual labels:  style-transfer, neural-style
Tensorflow Fast Style Transfer
A simple, concise tensorflow implementation of fast style transfer
Stars: ✭ 224 (+348%)
Mutual labels:  style-transfer, neural-style
Neural Style Audio Tf
TensorFlow implementation for audio neural style.
Stars: ✭ 413 (+726%)
Mutual labels:  style-transfer, neural-style
Fast Style Transfer
TensorFlow CNN for fast style transfer ⚡🖥🎨🖼
Stars: ✭ 10,240 (+20380%)
Mutual labels:  style-transfer, neural-style
Texture nets
Code for "Texture Networks: Feed-forward Synthesis of Textures and Stylized Images" paper.
Stars: ✭ 1,147 (+2194%)
Mutual labels:  style-transfer, neural-style
Faststyle
Tensorflow implementation of fast neural style transfer.
Stars: ✭ 170 (+240%)
Mutual labels:  style-transfer, neural-style
Neural Tools
Tools made for usage alongside artistic style transfer projects
Stars: ✭ 150 (+200%)
Mutual labels:  style-transfer, neural-style
Neural-Zoom-Legacy
Infinite Zoom For Style Transfer
Stars: ✭ 14 (-72%)
Mutual labels:  style-transfer, neural-style
MeuralPaint
TensorFlow implementation of CNN fast neural style transfer ⚡️ 🎨 🌌
Stars: ✭ 19 (-62%)
Mutual labels:  style-transfer, neural-style
Srgan
Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network
Stars: ✭ 2,641 (+5182%)
Mutual labels:  vgg, vgg19
Neural Style Pt
PyTorch implementation of neural style transfer algorithm
Stars: ✭ 456 (+812%)
Mutual labels:  style-transfer, neural-style
Neural Style
本代码加入了神经风格迁移中文注释,更易理解,同时新加入begin.py可直接运行调试。
Stars: ✭ 42 (-16%)
Mutual labels:  vgg, neural-style
Neural Style Audio Torch
Torch implementation for audio neural style.
Stars: ✭ 130 (+160%)
Mutual labels:  style-transfer, neural-style
Neural-Tile
A better tiling script for Neural-Style
Stars: ✭ 35 (-30%)
Mutual labels:  style-transfer, neural-style
Keras-Style-Transfer
An implementation of "A Neural Algorithm of Artistic Style" in Keras
Stars: ✭ 36 (-28%)
Mutual labels:  style-transfer, neural-style
mSRGAN-A-GAN-for-single-image-super-resolution-on-high-content-screening-microscopy-images.
Generative Adversarial Network for single image super-resolution in high content screening microscopy images
Stars: ✭ 52 (+4%)
Mutual labels:  vgg19
depth-preserving-neural-style-transfer
Depth-Preserving Style Transfer
Stars: ✭ 86 (+72%)
Mutual labels:  style-transfer

neural-style: Neural Style in Pytorch! 🎨

An implementation of the neural style in PyTorch! This notebook implements Image Style Transfer Using Convolutional Neural Networks by Leon Gatys, Alexander Ecker, and Matthias Bethge. Color preservation/Color transfer is based on the 2nd approach of discussed in Preserving Color in Neural Artistic Style Transfer by Leon Gatys, Matthias Betge, Aaron Hertzmann, and Eli Schetman.

This implementation is inspired by the implementations of:

The original caffe pretrained weights of VGG19 were used for this implementation, instead of the pretrained VGG19's in PyTorch's model zoo.

Examples: Style Transfer

Catriona Gray and Woman I by Willem de Kooning

Catriona

Janelle Monae and Starry Night by Vincent van Gogh

Janelle Monae

Andrew Y. Ng and Oil Painting of a Girl in Rain

AndrewYNg

Style Transfers of Golden Bridge

dubnation

Some Old Man + Increasing Style Weights of Starry Night

Philippine Idiot

Examples: Style Transfer while Preserving the original color

Janelle Monae and Starry Night by Vincent van Gogh + Preserve Original Color

Janelle Monae Preserve

Requirements

NOTE: For Google-Colab users - All data files and dependencies can be installed by running the uppermost cell of the notebook! See Usage!

Data Files

Dependecies

Usage

If you don't have a GPU, you may want to run the notebook in Google Colab! Colab is a cloud-GPU service with an interface similar to Jupyter notebook. A separate instruction is included to get started with Colab.

Local GPU

After installing the dependencies, run models/download_model.sh script to download the pretrained VGG19 weights.

sh models/download_models.sh

Codes are implemented inside the neural_style.ipynb notebook. Jupyter notebook environment is needed to run notebook.

jupyter notebook

Google Colab

The included notebook file is a Google-Colab-ready notebook! Uncomment and run the first cell to download the demo pictures, and VGG19 weights. It will also install the dependencies (i.e. PyTorch and torchvision).

# Download VGG19 Model
!wget -c https://web.eecs.umich.edu/~justincj/models/vgg19-d01eb7cb.pth
!mkdir models
!cp vgg19-d01eb7cb.pth models/

# Download Images
!wget -c https://github.com/iamRusty/neural-style-pytorch/archive/master.zip
!unzip -q master.zip
!mkdir images
!cp neural-style-pytorch-master/images/1-content.png images
!cp neural-style-pytorch-master/images/1-style.jpg images

Options

Image

  • MAX_IMAGE_SIZE: sets the max dimension of height or weight. Bigger GPU memory is needed to run larger images. Default is 512px.
  • INIT_IMAGE: sets the initial image file to either 'random' or 'content'. Default is random which initializes a noise image. Content copies a resized content image, giving free optimization of content loss!
  • CONTENT_PATH: path of the content image
  • STYLE_PATH: path of the style image
  • PRESERVE_COLOR: determines whether to preserve the color of the content image. True preserves the color of the content image. Default value is False
  • PIXEL_CLIP: determines whether to clip the resulting image. True clips the pixel values to [0, 255]. Default value is True

Optimizer

  • OPTIMIZER: sets the optimizer to either 'adam' or 'lbfgs'. Default optimizer is Adam with learning rate of 10. L-BFGS was used in the original (matlab) implementation of the reference paper.
  • ADAM_LR: learning rate of the adam optimizer. Default is 1e1
  • CONTENT_WEIGHT: Multiplier weight of the loss between content representations and the generated image. Default is 5e0
  • STYLE_WEIGHT: Multiplier weight of the loss between style representations and the generated image. Default is 1e2
  • TV_WEIGHT: Multiplier weight of the Total Variation Denoising. Default is 1e-3
  • NUM_ITER: Iterations of the style transfer. Default is 500
  • SHOW_ITER: Number of iterations before showing and saving the generated image. Default is 100

Model

  • VGG19_PATH = path of VGG19 Pretrained weights. Default is 'models/vgg19-d01eb7cb.pth'
  • POOL: Defines which pooling layer to use. The reference paper suggests using average pooling! Default is 'max'

Todo!

  • Multiple Style blending
  • High-res Style Transfer
  • Color-preserving Style Transfer
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].