Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Generative Adversarial Networks Projects

You're reading from  Generative Adversarial Networks Projects

Product type Book
Published in Jan 2019
Publisher Packt
ISBN-13 9781789136678
Pages 316 pages
Edition 1st Edition
Languages
Author (1):
Kailash Ahirwar Kailash Ahirwar
Profile icon Kailash Ahirwar

Table of Contents (11) Chapters

Preface 1. Introduction to Generative Adversarial Networks 2. 3D-GAN - Generating Shapes Using GANs 3. Face Aging Using Conditional GAN 4. Generating Anime Characters Using DCGANs 5. Using SRGANs to Generate Photo-Realistic Images 6. StackGAN - Text to Photo-Realistic Image Synthesis 7. CycleGAN - Turn Paintings into Photos 8. Conditional GAN - Image-to-Image Translation Using Conditional Adversarial Networks 9. Predicting the Future of GANs 10. Other Books You May Enjoy

The Keras implementation of SRGAN

As we discussed, SRGAN has three neural networks, a generator, a discriminator, and a pre-trained VGG19 network on the Imagenet dataset. In this section, we will write the implementation for all the networks. Let's start by implementing the generator network.

Before starting to write the implementations, create a Python file called main.py and import the essential modules, as follows:

import glob
import os

import numpy as np
import tensorflow as tf
from keras import Input
from keras.applications import VGG19
from keras.callbacks import TensorBoard
from keras.layers import BatchNormalization, Activation, LeakyReLU, Add, Dense, PReLU, Flatten
from keras.layers.convolutional import Conv2D, UpSampling2D
from keras.models import Model
from keras.optimizers import Adam
from keras_preprocessing.image import img_to_array, load_img
from scipy.misc import imsave...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}