"Rules: Logic and Applications" 2nd Workshop, Dec, 2019 |
Aesthetic Morphisms |
Jocelyn Ireson-Paine |
www.jocelyns-cartoons.uk/rules2019/ |
| Slides as PDF | Artistic Techniques Database Demo | Artistic Techniques Database Video | Contact |
The task being learnt was to enhance
very simple stick-and-blob cartoons.
The cartoons featured people either
walking or running, the difference being
visible in the position of legs and arms.
Enhancement means: adding shadows under
feet; adding motion lines behind
a runner's feet; adding hair, which streams backwards
for runners; and adding eyebrows, which are level
for non-runners and raised for runners.
Code as in Jason Brownlee's "How to Develop a Pix2Pix GAN for Image-to-Image Translation". No changes other than to filenames, image input, and constants such as number of training iterations.
Python 3.6.1 on Windows 10.
All software was free. The code uses the open-source Keras neural-net library. This runs on TensorFlow, developed by Google for expressing computations on vectors and matrices as dataflow graphs. Also uses Python's scientific library NumPy.
I used a very small training set — 18 input-output pairs. This was because TensorFlow is slow on my laptop unless run on an Nvidia Graphics Processing Card, which I don't have.
I drew training images by hand in black and red coloured pencil. The enhancements were always in red, and the rest in black, enabling me to use colour-channel separation in the Gimp image editor to split one image into an input-output pair. All images were scaled to 256×256 pixels, to fit Brownlee's code (and save training time).
No automatic data augmentation (see Jason Brownlee's "How to Configure Image Data Augmentation in Keras"). I did a small amount of manual augmentation by moving and rescaling scanned images before saving.
I have seen quite a few articles which claim that style transfer was developed to avoid the need for training sets. However, I'm an artist. I don't mind drawing lots of training examples!