January 2019
Intermediate to advanced
316 pages
8h 16m
English
As mentioned, pix2pix has two networks: a generator and a discriminator. The generator is inspired by the architecture of U-Net. Similarly, the discriminator network is inspired by the architecture of PatchGAN. We will implement both networks in the following sections.
Before starting to write the implementations, create a Python file main.py and import the essential modules as follows:
import osimport timeimport h5pyimport keras.backend as Kimport matplotlib.pyplot as pltimport numpy as npfrom cv2 import imwritefrom keras import Input, Modelfrom keras.layers import Convolution2D, LeakyReLU, BatchNormalization, UpSampling2D, Dropout, Activation, Flatten, Dense, Lambda, Reshape, concatenatefrom keras.optimizers ...
Read now
Unlock full access