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 globimport osimport numpy as npimport tensorflow as tffrom keras import Inputfrom keras.applications import VGG19from keras.callbacks import TensorBoardfrom keras.layers import BatchNormalization, Activation, LeakyReLU, Add, Dense, PReLU, Flattenfrom keras.layers.convolutional import Conv2D, UpSampling2Dfrom keras.models ...

Get Generative Adversarial Networks Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.