Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tensorflow implementation of "Perceptual Losses for Real-Time Style Transfer and Super-Resolution"

Fast artistic style transfer by using feed forward network.

  • input image size: 1024x768
  • process time(CPU): 2.246 sec (Core i5-5257U)
  • process time(GPU): 1.728 sec (GPU GRID K520)

Requirement

$ pip install tensorflow

Prerequisite

Download VGG16 model and convert it into smaller file so that we use only the convolutional layers which are 10% of the entire model. The VGG model part in this implementation were based on Tensorflow VGG16 and VGG19. PLEASE COMMENT the initialization function in tensorflow-vgg/vgg16.py, and also remember to download the npy file for VGG16.

Train

Need to train one image transformation network model per one style target. According to the paper, the models are trained on the Microsoft COCO dataset. Also, it will save the transformation model, including the trained weights, for later use (in C++) in graphs directory, while the checkpoint files would be saved in models directory.

python train.py -s <style_image_path> -d <training_dataset_path> -g 0

Generate

python generate.py <input_image_path> -m <model_path> -o <output_image_path>

Difference from paper

  • Convolution kernel size 4 instead of 3.
  • Training with batchsize(n>=2) hasn't been tested yet.

License

MIT

Reference

Code structure written in this repository are based on following nice works, thanks to the author.

About

Tensorflow implementation of "Perceptual Losses for Real-Time Style Transfer and Super-Resolution."

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages