All Projects → naoto0804 → Pytorch Adain

naoto0804 / Pytorch Adain

Licence: mit
Unofficial pytorch implementation of 'Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization' [Huang+, ICCV2017]

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pytorch Adain

Vincent Ai Artist
Style transfer using deep convolutional neural nets
Stars: ✭ 176 (-68%)
Mutual labels:  cnn, style-transfer
Cyclegan Music Style Transfer
Symbolic Music Genre Transfer with CycleGAN
Stars: ✭ 201 (-63.45%)
Mutual labels:  cnn, style-transfer
Style transfer
CNN image style transfer 🎨.
Stars: ✭ 210 (-61.82%)
Mutual labels:  cnn, style-transfer
Food Recipe Cnn
food image to recipe with deep convolutional neural networks.
Stars: ✭ 448 (-18.55%)
Mutual labels:  cnn
Neural Style Pt
PyTorch implementation of neural style transfer algorithm
Stars: ✭ 456 (-17.09%)
Mutual labels:  style-transfer
Pycnn
Image Processing with Cellular Neural Networks in Python
Stars: ✭ 509 (-7.45%)
Mutual labels:  cnn
How To Learn Deep Learning
A top-down, practical guide to learn AI, Deep learning and Machine Learning.
Stars: ✭ 544 (-1.09%)
Mutual labels:  cnn
Pytorch Inpainting With Partial Conv
Unofficial pytorch implementation of 'Image Inpainting for Irregular Holes Using Partial Convolutions' [Liu+, ECCV2018]
Stars: ✭ 440 (-20%)
Mutual labels:  cnn
Textclassificationbenchmark
A Benchmark of Text Classification in PyTorch
Stars: ✭ 534 (-2.91%)
Mutual labels:  cnn
Regl Cnn
Digit recognition with Convolutional Neural Networks in WebGL
Stars: ✭ 490 (-10.91%)
Mutual labels:  cnn
Paddlepaddle code
用PaddlePaddle和Tensorflow实现常用的深度学习算法
Stars: ✭ 485 (-11.82%)
Mutual labels:  cnn
Awesome Local Global Descriptor
My personal note about local and global descriptor
Stars: ✭ 466 (-15.27%)
Mutual labels:  cnn
Cnn Facial Landmark
Training code for facial landmark detection based on deep convolutional neural network.
Stars: ✭ 516 (-6.18%)
Mutual labels:  cnn
Cryptocurrencyprediction
Predict Cryptocurrency Price with Deep Learning
Stars: ✭ 453 (-17.64%)
Mutual labels:  cnn
Deeplearning
深度学习入门教程, 优秀文章, Deep Learning Tutorial
Stars: ✭ 6,783 (+1133.27%)
Mutual labels:  cnn
D2 Net
D2-Net: A Trainable CNN for Joint Description and Detection of Local Features
Stars: ✭ 448 (-18.55%)
Mutual labels:  cnn
Music recommender
Music recommender using deep learning with Keras and TensorFlow
Stars: ✭ 528 (-4%)
Mutual labels:  cnn
Lstm Fcn
Codebase for the paper LSTM Fully Convolutional Networks for Time Series Classification
Stars: ✭ 482 (-12.36%)
Mutual labels:  cnn
Ssr Net
[IJCAI18] SSR-Net: A Compact Soft Stagewise Regression Network for Age Estimation
Stars: ✭ 475 (-13.64%)
Mutual labels:  cnn
Demon
DeMoN: Depth and Motion Network
Stars: ✭ 501 (-8.91%)
Mutual labels:  cnn

pytorch-AdaIN

This is an unofficial pytorch implementation of a paper, Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization [Huang+, ICCV2017]. I'm really grateful to the original implementation in Torch by the authors, which is very useful.

Results

Requirements

Please install requirements by pip install -r requirements.txt

  • Python 3.5+
  • PyTorch 0.4+
  • TorchVision
  • Pillow

(optional, for training)

  • tqdm
  • TensorboardX

Usage

Download models

Download decoder.pth/vgg_normalized.pth and put them under models/.

Test

Use --content and --style to provide the respective path to the content and style image.

CUDA_VISIBLE_DEVICES=<gpu_id> python test.py --content input/content/cornell.jpg --style input/style/woman_with_hat_matisse.jpg

You can also run the code on directories of content and style images using --content_dir and --style_dir. It will save every possible combination of content and styles to the output directory.

CUDA_VISIBLE_DEVICES=<gpu_id> python test.py --content_dir input/content --style_dir input/style

This is an example of mixing four styles by specifying --style and --style_interpolation_weights option.

CUDA_VISIBLE_DEVICES=<gpu_id> python test.py --content input/content/avril.jpg --style input/style/picasso_self_portrait.jpg,input/style/impronte_d_artista.jpg,input/style/trial.jpg,input/style/antimonocromatismo.jpg --style_interpolation_weights 1,1,1,1 --content_size 512 --style_size 512 --crop

Some other options:

  • --content_size: New (minimum) size for the content image. Keeping the original size if set to 0.
  • --style_size: New (minimum) size for the content image. Keeping the original size if set to 0.
  • --alpha: Adjust the degree of stylization. It should be a value between 0.0 and 1.0 (default).
  • --preserve_color: Preserve the color of the content image.

Train

Use --content_dir and --style_dir to provide the respective directory to the content and style images.

CUDA_VISIBLE_DEVICES=<gpu_id> python train.py --content_dir <content_dir> --style_dir <style_dir>

For more details and parameters, please refer to --help option.

I share the model trained by this code here

References

  • [1]: X. Huang and S. Belongie. "Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization.", in ICCV, 2017.
  • [2]: Original implementation in Torch
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].