All Projects → Lornatang → SRGAN-PyTorch

Lornatang / SRGAN-PyTorch

Licence: Apache-2.0 license
A simple and complete implementation of super-resolution paper.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to SRGAN-PyTorch

BetterDummy
Unlock your displays on your Mac! Smooth scaling, HiDPI unlock, XDR/HDR extra brightness upscale, DDC, brightness and dimming, dummy displays, PIP and lots more!
Stars: ✭ 9,601 (+3509.4%)
Mutual labels:  resolution
Paddlegan
PaddlePaddle GAN library, including lots of interesting applications like First-Order motion transfer, wav2lip, picture repair, image editing, photo2cartoon, image style transfer, and so on.
Stars: ✭ 4,987 (+1774.81%)
Mutual labels:  resolution
WinReform
A simple tool to help resize and relocate stubborn windows.
Stars: ✭ 20 (-92.48%)
Mutual labels:  resolution
MIRNet-Keras
Keras Implementation of MIRNet - SoTA in Image Denoising, Super Resolution and Image Enhancement - CVPR 2020
Stars: ✭ 21 (-92.11%)
Mutual labels:  resolution
instagram-profile-picture
💎 Get url to the profile picture (and more) of any Instagram user in different resolutions!
Stars: ✭ 37 (-86.09%)
Mutual labels:  resolution
django-js-routes
Expose and perform reverse lookups of Django URLs in the frontend world.
Stars: ✭ 20 (-92.48%)
Mutual labels:  resolution
res
Device resolution detection module
Stars: ✭ 35 (-86.84%)
Mutual labels:  resolution
resolution
A library to resolve blockchain domain names.
Stars: ✭ 190 (-28.57%)
Mutual labels:  resolution
Psychic-CCTV
A video analysis tool built completely in python.
Stars: ✭ 21 (-92.11%)
Mutual labels:  resolution
resolution-go
Golang library for resolving unstoppable domains
Stars: ✭ 24 (-90.98%)
Mutual labels:  resolution
ESRGAN-tensorflow
Enhanced SRGAN. Champion PIRM Challenge on Perceptual Super-Resolution
Stars: ✭ 33 (-87.59%)
Mutual labels:  resolution
ImageDownloader
A program for downloading and filtering images based on their resolution.
Stars: ✭ 60 (-77.44%)
Mutual labels:  resolution
resolutions-2019
A list of data mining and machine learning papers that I implemented in 2019.
Stars: ✭ 19 (-92.86%)
Mutual labels:  resolution
qt-quick-responsive-helper
A simple toolbar for QtQuick based applications, to let developers test different resolutions and dpi settings easily. It was made to be integrated with minimal effort (only one QML file), and to be configurable for your specific usage.
Stars: ✭ 26 (-90.23%)
Mutual labels:  resolution
libsrcnn
Super-Resolution imaging with Convolutional Neural Network library for G++, Non-OpenCV model.
Stars: ✭ 14 (-94.74%)
Mutual labels:  resolution
gini
A fast SAT solver
Stars: ✭ 139 (-47.74%)
Mutual labels:  resolution
RFB ESRGAN-PyTorch
Simple realization of papers in oppo Research Institute super score competition.
Stars: ✭ 62 (-76.69%)
Mutual labels:  resolution
agrid
A grid for modelling, analyse, map and visualise multidimensional and multivariate data
Stars: ✭ 16 (-93.98%)
Mutual labels:  resolution
choco-screen-resolution
Sets the screen resolution on Windows virtual machines (VMs)
Stars: ✭ 24 (-90.98%)
Mutual labels:  resolution
typeioc
Dependency injection container for typescript / javascript
Stars: ✭ 32 (-87.97%)
Mutual labels:  resolution

SRGAN-PyTorch

Overview

This repository contains an op-for-op PyTorch reimplementation of Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network.

Table of contents

Download weights

Download datasets

Contains DIV2K, DIV8K, Flickr2K, OST, T91, Set5, Set14, BSDS100 and BSDS200, etc.

Please refer to README.md in the data directory for the method of making a dataset.

How Test and Train

Both training and testing only need to modify the srresnet_config.py file and srgan_config.py file.

Test

Modify the srgan_config.py file.

  • line 32: g_arch_name change to srresnet_x4.
  • line 39: upscale_factor change to 4.
  • line 41: mode change to test.
  • line 43: exp_name change to SRGAN_x4-DIV2K.
  • line 96: g_model_weights_path change to ./results/pretrained_models/SRGAN_x4-ImageNet-8c4a7569.pth.tar.
python3 test.py

Train SRResNet model

Modify the srresnet_config.py file.

  • line 32: g_arch_name change to srresnet_x4.
  • line 39: upscale_factor change to 4.
  • line 41: mode change to train.
  • line 43: exp_name change to SRResNet_x4-DIV2K.
python3 train_srresnet.py

Resume train SRResNet model

Modify the srresnet_config.py file.

  • line 32: g_arch_name change to srresnet_x4.
  • line 39: upscale_factor change to 4.
  • line 41: mode change to train.
  • line 43: exp_name change to SRResNet_x4-DIV2K.
  • line 59: resume_g_model_weights_path change to ./samples/SRGAN_x4-DIV2K/g_epoch_xxx.pth.tar.
python3 train_srresnet.py

Train SRGAN model

  • line 31: d_arch_name change to discriminator.
  • line 32: g_arch_name change to srresnet_x4.
  • line 39: upscale_factor change to 4.
  • line 41: mode change to train.
  • line 43: exp_name change to SRGAN_x4-DIV2K.
  • line 58: pretrained_g_model_weights_path change to ./results/SRResNet_x4-DIV2K/g_last.pth.tar.
python3 train_srgan.py

Resume train SRGAN model

  • line 31: d_arch_name change to discriminator.
  • line 32: g_arch_name change to srresnet_x4.
  • line 39: upscale_factor change to 4.
  • line 41: mode change to train.
  • line 43: exp_name change to SRGAN_x4-DIV2K.
  • line 61: resume_d_model_weights_path change to ./samples/SRGAN_x4-DIV2K/d_epoch_xxx.pth.tar.
  • line 62: resume_g_model_weights_path change to ./samples/SRGAN_x4-DIV2K/g_epoch_xxx.pth.tar.
python3 train_srgan.py

Result

Source of original paper results: https://arxiv.org/pdf/1609.04802v5.pdf

In the following table, the psnr value in () indicates the result of the project, and - indicates no test.

Set5 Scale SRResNet SRGAN
PSNR 4 32.05(32.14) 29.40(30.64)
SSIM 4 0.9019(0.8954) 0.8472(0.8642)
Set14 Scale SRResNet SRGAN
PSNR 4 28.49(28.57) 26.02(27.12)
SSIM 4 0.8184(0.7815) 0.7397(0.7321)
BSD100 Scale SRResNet SRGAN
PSNR 4 27.58(27.56) 25.16(26.22)
SSIM 4 0.7620(0.7367) 0.6688(0.6867)
# Download `SRGAN_x4-ImageNet-8c4a7569.pth.tar` weights to `./results/pretrained_models`
# More detail see `README.md<Download weights>`
python3 ./inference.py

Input:

Output:

Build `srresnet_x4` model successfully.
Load `srresnet_x4` model weights `./results/pretrained_models/SRGAN_x4-ImageNet-8c4a7569.pth.tar` successfully.
SR image save to `./figure/comic_sr.png`

Contributing

If you find a bug, create a GitHub issue, or even better, submit a pull request. Similarly, if you have questions, simply post them as GitHub issues.

I look forward to seeing what the community does with these models!

Credit

Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network

Christian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, Wenzhe Shi

Abstract
Despite the breakthroughs in accuracy and speed of single image super-resolution using faster and deeper convolutional neural networks, one central problem remains largely unsolved: how do we recover the finer texture details when we super-resolve at large upscaling factors? The behavior of optimization-based super-resolution methods is principally driven by the choice of the objective function. Recent work has largely focused on minimizing the mean squared reconstruction error. The resulting estimates have high peak signal-to-noise ratios, but they are often lacking high-frequency details and are perceptually unsatisfying in the sense that they fail to match the fidelity expected at the higher resolution. In this paper, we present SRGAN, a generative adversarial network (GAN) for image super-resolution (SR). To our knowledge, it is the first framework capable of inferring photo-realistic natural images for 4x upscaling factors. To achieve this, we propose a perceptual loss function which consists of an adversarial loss and a content loss. The adversarial loss pushes our solution to the natural image manifold using a discriminator network that is trained to differentiate between the super-resolved images and original photo-realistic images. In addition, we use a content loss motivated by perceptual similarity instead of similarity in pixel space. Our deep residual network is able to recover photo-realistic textures from heavily downsampled images on public benchmarks. An extensive mean-opinion-score (MOS) test shows hugely significant gains in perceptual quality using SRGAN. The MOS scores obtained with SRGAN are closer to those of the original high-resolution images than to those obtained with any state-of-the-art method.

[Paper]

@InProceedings{srgan,
    author = {Christian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, Wenzhe Shi},
    title = {Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network},
    booktitle = {arXiv},
    year = {2016}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].