16.03.2021 Views

Advanced Deep Learning with Keras

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7

Figure 7.1.10: Color (from Figure 7.1.9) to the grayscale conversion of CycleGAN

The reader can run the image translation by using the pretrained models for

CycleGAN with PatchGAN:

python3 cyclegan-7.1.1.py --cifar10_g_source=cyclegan_cifar10-g_source.h5

--cifar10_g_target=cyclegan_cifar10-g_target.h5

CycleGAN on MNIST and SVHN datasets

We're now going to tackle a more challenging problem. Suppose we use MNIST

digits in grayscale as our source data, and we want to borrow style from SVHN [1]

which is our target data. The sample data in each domain are shown in Figure 7.1.11.

We can reuse all the build and train functions for CycleGAN that were discussed in

the previous section to perform style transfer. The only difference is we have to add

routines for loading MNIST and SVHN data. SVHN dataset can be found at http://

ufldl.stanford.edu/housenumbers/.

[ 227 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!