llSourcell / AI_Artist

AI Artist for Machine Learning for Hackers #5
235 stars 91 forks source link

Overview

A project that trains a convolutional neural network over a dataset to repaint an novel image in the style of a given painting. This is the implementation of Neural Style Transfer from the paper A Neural Algorithm of Artistic Style in Keras 1.0.2. This is also the code for 'Build an AI Artist' on Youtube

Alt Text

Dependencies

Use pip to install any missing dependencies

If you have dependency version issues, use virtualenv

Basic Usage

There are 3 images to identify when we run the script

  1. Your base image (to artify)
  2. Your reference image (the art to learn from)
  3. Your generated image

Run the following comand to generate an image in your chosen style

python network.py --base_image_path /path/to/your/image --style_reference_image_path /path/to/your/painting --result_prefix /path/to/generated/file/you/create

Other optional commands are

I'd run this on AWS, but you can run this locally too if you have a GPU. On a 980M GPU, the time required for each epoch depends on mainly image size (gram matrix size) :

Credits

Credit for the vast majority of code here goes to Somsubra Majumdar. I've merely created a wrapper around all of the important functions to get people started.