Skip to content

Neural style art transfer made using a VGG-16 convolutional neural network using Keras and TensorFlow.

Notifications You must be signed in to change notification settings

nickinack/NeuralStyleTransfer-VGG16

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neural Style transfer using VGG-16 CNN

About

Implementation of A Neural Algorithm of Artistic Style by Leon A. Gatys, Alexander S. Ecker, Matthias Bethge . This rendition has been done using a VGG-16 neural network. Keras and Tensorflow has been used along with Scipy Fmin_l_bfgs_b optimizer.

Modifications

Instead of using a random noise initializer for the input image, the existing content image's values are copied to the input image. Styling weights are customizable depending upon the user specifications.

Libraries

keras==2.3.1
tensorflow==1.15.3
scipy==1.4.1

Algorithm

The styling, content and the output tensors are stacked up as the input image. This tensor passes into the VGG-16 and the output is also a 3xheightxwidthx3 tensor. The third tensor in the output layer (Generated Image) accounts for the smoothness. The activations in the 5th Convolutional block's conv_2 is used to calculate content cost and various other convolutional layers belonging to each block is used to calculate style cost. Here , the regularization factor used for styling is primarily higher than the others. Image has been saved after deprocessing and reverting the effects brought by the VGG-16 passage.

Running Instructions

To execute and run these files, download and open them in your Jupyter lab/ Jupyter notebook

If you do not have jupyter notebook/lab, download them using the following code :

pip install jupyterlab
pip install notebook

After installing , you may open your notebooks using the following command:

jupyter lab
jupyter notebook

NOTE

Please note that since my system couldn't handle any image size greater thatn 400x400x3 to pass into VGG, I have implemented this only for 128x196x3. If required, please set the image size to appropriate dimensions and train the network.

Contributors

Karthik Viswanathan

About

Neural style art transfer made using a VGG-16 convolutional neural network using Keras and TensorFlow.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages