Skip to main content

Super Resolution with Real-ESRGAN

Victoria Harbour, Hongkong

Github Repository

Project Setup

This project uses the Real-ESRGAN repository available on Github:

git clone https://github.com/mpolinowski/Real-ESRGAN

And we will be using a pre-trained model that can be downloaded from here:

cd Real-ESRGAN
wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P experiments/pretrained_models

Install Dependencies

All dependencies are listed in the requirements.txt file:

basicsr>=1.3.3.11
facexlib>=0.2.0.3
gfpgan>=0.2.1
numpy
opencv-python
Pillow
torch>=1.7
torchvision
tqdm
daal==2021.2.3
pip3 install -r requirements.txt

And run the setup script:

python setup.py develop

Run Up-Sampling

We can run the following script included inside the repository to feed images from the ./inputs directory into our GAN and output the up-sampled images into the ./results folder:

python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs --face_enhance

Results

ESRGAN Super Resolution

ESRGAN Super Resolution