Visual Machine Learning for Artists

  • Allowing ML models to distinguish between one class of images and another
  • Training a model through transfer learning to understand new images through our own guidance.
  • Real-time classification of recognized objects in video using pre-trained models such as imagenet.

Machine Learning with Images

CNNs

How Neural Networks Understand Images

Convnet Viewer

Image Classification

  • Download the class files
  • Make a directory on your computer to hold the class files.
  • Start a web server:
  • python -V — gives you your python version.
  • Python 2: python -m SimpleHTTPServer
  • Python 3: python -m http.server
  • Open your browser to localhost:8000
  • Open the 00-imagenet-classifier.html file
  • Open the 01-image-classifier.html example, and its corresponding javascript file: assets/js/01-image-classification.js.
  • Make sure you can see yourself in the webcam window
  • Make a pose (pretend you’re a dog?) and hit the add pose1 image button about 10–20 times. You can move around or change your pose slightly.
  • Make a different pose (pretend you’re a cat) and hit the add pose 2 image button 10–20 times.
  • Click train and wait for it to train your model.
  • Make a pose of your choice and hit start guessing. The AI should be able to classify whether you are posing like a dog or a cat.

Style Transfer

Style Transfer Examples

Creating your own style

  • Log in to paperspace in your console:
  • Pick an image from your computer that you want as the reference style. Make it no bigger than 500x500 pixels.
  • Update the python script to reference that image.
  • In run.sh, change the path of — style images/[YOUR_IMAGE] to the filename of the image you want for styling all other images.
  • Create a paperspace job to process the training in the cloud. This will take a few hours.
  • — container refers to a docker image that is pre-configured to do our style transfer processing. It installs all the stuff to train the model on the gradient cloud computer so we don’t have to install it ourselves on our own machines.
  • — machineType is a reference to the computer we want to use for processing. Faster machines cost more money. P5000 is a mid-tier machine.
  • — command runs the run.sh script that we edited.
  • — project can be whatever we want to call this so we have a reference in Paperspace.
  • Point the sample project to our new model directory
  • Run, and view the result!
  • From the directory containing sketch.js, run python -m SimpleHTTPServer (python2) or python -m http.server (python3).

Current Examples of Machine Learning for Images/Video

For Next Class

  • Bring in an example of style transfer being trained on a model an image of your choosing.
  • Try to find a large body of text from which you want to work. The bigger the better (we’re talking a book’s worth. Multiple books, even better). Try to find something very stylistic and unique, as we’ll be generating text in that style. We will need to be able to put all that text into a file (or download a file).
  • Come up with a project you might like to do with machine learning and images. You don’t have to make it, but we will share our ideas in class. If you come across anything cool that’s currently being done in ML, we’ll share that as well.

--

--

--

Freelance Creative Coder

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

An introduction to NLP and 5 tips for raising your game

Confusion Matrix — Are you confused ? (Part 1)

How does Panorama work? Image Stitching

A study for parallel computational models

FUNDAMENTALS OF SUPERVISED LEARNING FROM SCHOOL MATHEMATICS !!

Ensemble Technique — Wisdom of the crowd!!!

Design principles for a real time machine learning framework

An Overview of Deep Learning — from History to Fundamentals

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mike Heavers

Mike Heavers

Freelance Creative Coder

More from Medium

Image classification with transfer learning on tensorflow

Satellite Image Classification With Deep Learning

A Look Under the Hood of Pytorch’s Recurrent Neural Network Module

Curriculum Learning in Deep