Coder Social home page Coder Social logo

ai_artist's Introduction

UNRELEASED, THIS VIDEO COMES OUT ON SUNDAY. IGNORE THIS FOR NOW.

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 Shot --style_reference_image_path /path/to/your/painting --result_prefix /path/to/generated/file/you/create

Other optional commands are

  • --image_size: Size of your output image
  • --content_weight: How much to weigh the content
  • --style_weight: How much to weigh the style
  • -style_scale: How much to scale the style
  • --total_variation_weight: Uniformity of the generated image
  • --num_iter: Nmber of iterations
  • --rescale_image: to rescale or not to rescale
  • --rescale_method: rescale algorithm
  • --maintain_aspect_ratio: to maintain aspect ratio or not
  • --content_layer: which layer to focus on for content generation

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) :

  • For a 400x400 gram matrix, each epoch takes approximately 11-13 seconds.
  • For a 512x512 gram matrix, each epoch takes approximately 18-22 seconds.
  • For a 600x600 gram matrix, each epoch takes approximately 28-30 seconds.

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.

ai_artist's People

Contributors

llsourcell avatar testbounty avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.