Skip to content

WellyZhang/PyNeuralArt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyNeuralArt

Introduction

This fork contains a Caffe-based implementation of A Neural Algorithm of Artistic Style, which presents a method for transferring the artistic style of one input image onto another.

Different from the original master, this fork removes unnecessary code and dependencies while still preserving the core and idea of the algorithm.

In my version, the nertwork operations are handled by Caffe, while loss minimization and other miscellaneous matrix operations are performed using numpy and scipy. L-BFGS is adopted for optimization.

To run the code, first set the correct model in the demo.py, e.g. GoogLeNet, VGG16, VGG19 or simply CaffeNet and put the corresponding pretrained caffemodel in the folder so that the program could correctly find it. Then

python demo.py -s <style-image> -c <content-image>

You are also encouraged to read the style.py which is the core of the algorithm.

Requirements

  • Caffe and PyCaffe
  • Numpy
  • Scipy
  • OpenCV

Examples

The style image is the Starry Night:

style-image

The content image is a photo of Johannesburg:

content-image

The result is Starry Johannesburg:

result

References

The original paper could be found here.

The master of the repository resides here.

About

Python Implementation of A Neural Algorithm of Artistic Style

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%