Let us start with the recipe:
- Import a few modules such as numpy, scipy, tensorflow, and matplotlib. Then import PIL to manipulate images. Note that as this code runs on a Jupyter notebook that you can download from online, the fragment %matplotlib inline has been added:
import os import sys import numpy as np import scipy.io import scipy.misc import tensorflow as tf import matplotlib.pyplot as plt from matplotlib.pyplot import imshow from PIL import Image %matplotlib inline from __future__ import division
- Then, set the input path for the image used to learn the style and for the content image to be repainted according to the style:
OUTPUT_DIR = 'output/' # Style image STYLE_IMAGE = 'data/StarryNight.jpg' # Content image ...