ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks¶Star | Fork | Issue
Pipeine for Image Super-Resolution task that based on a frequently cited paper, ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks (Wang Xintao et al.), published in 2018.
In few words, image super-resolution (SR) techniques reconstruct a higher-resolution (HR) image or sequence from the observed lower-resolution (LR) images, e.g. upscaling of 720p image into 1080p.
One of the common approaches to solving this task is to use deep convolutional neural networks capable of recovering HR images from LR ones. And ESRGAN (Enhanced SRGAN) is one of them. Key points of ESRGAN:
SRResNet-based architecture with residual-in-residual blocks;
Mixture of context, perceptual, and adversarial losses. Context and perceptual losses are used for proper image upscaling, while adversarial loss pushes neural network to the natural image manifold using a discriminator network that is trained to differentiate between the super-resolved images and original photo-realistic images.
Catalyst as pipeline runner for deep learning tasks. This new and rapidly developing library can significantly reduce the amount of boilerplate code. If you are familiar with the TensorFlow ecosystem, you can think of Catalyst as Keras for PyTorch. This framework is integrated with logging systems such as the well-known TensorBoard.
Pytorch, torchvision, and PIQ as main frameworks for deep learning.
Albumentations for data preprocessing.
esrgan requires python >= 3.8. The requirements.txt file can be used to install the necessary packages.
git clone https://github.com/leverxgroup/esrgan.git pip install ./esrgan
Run an experiment¶
# step 1 - supervised training of the model catalyst-dl run -C esrgan/experiment/config_supervised.yml --benchmark # step 2 - use weights from step 1 to train model using GAN approach catalyst-dl run -C esrgan/experiment/config_gan.yml --benchmark
where esrgan/experiment/config.yml is a path to the config file.
Some examples of work of ESRGAN model trained on DIV2K dataset:
LR (low resolution)
HR (high resolution)
The project’s GitHub repository can be found here. Bugfixes and contributions are very much appreciated!
esrgan is released under a CC BY-NC-ND 4.0 license. See LICENSE for additional details about it.