Training SRGAN to generate high-resolution images

Of course, we need to have some data to work with. We simply need to download the training images from the links in the README.md file. You can always use any image collection you like since the training of SRGAN only requires low-resolution images (which can be easily acquired by resizing to smaller scales) besides the original images.

Create a folder named data and place the training images into a folder called DIV2K_train_HR and the valid images into DIV2K_valid_HR. Next, create a folder named epochs to hold the epoch data. Finally, create a folder named training_results.

To train SRGAN, execute the following command in a Terminal:

$ pip install tqdm, pandas$ python train.py

The image collection ...

Get Hands-On Generative Adversarial Networks with PyTorch 1.x 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.