Translating images with Pix2Pix
One of the most interesting applications of GANs is image-to-image translation, which, as the name suggests, consists of translating the content from one image domain to another (for instance, sketches to photos, black and white images to RGB, and Google Maps to satellite views, among others).
In this recipe, we'll implement a fairly complex conditional adversarial network known as Pix2Pix. We'll focus solely on the practical aspects of the solution, but if you want to get familiar with the literature, check out the See also section at the end of the recipe.
Getting ready
We'll use the cityscapes
dataset, which is available here: https://people.eecs.berkeley.edu/~tinghuiz/projects/pix2pix/datasets/cityscapes.tar.gz. Download it and decompress it in a location of your choosing. For the purposes of this tutorial, we will assume that it's placed in the ~/.keras/datasets
directory, under the name cityscapes
. To display a progress...