GithubHelp home page GithubHelp logo

sunnshinny / srgan-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lornatang/srgan-pytorch

0.0 0.0 0.0 2.29 MB

A simple and complete implementation of super-resolution paper.

License: Apache License 2.0

Python 100.00%

srgan-pytorch's Introduction

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.

Test

Modify the contents of the file as follows.

  • line 29: upscale_factor change to the magnification you need to enlarge.
  • line 31: mode change Set to valid mode.
  • line 100: model_path change weight address after training.

Train

Modify the contents of the file as follows.

  • line 29: upscale_factor change to the magnification you need to enlarge.
  • line 31: mode change Set to train mode.

If you want to load weights that you've trained before, modify the contents of the file as follows.

Train SRResNet model

  • line 47: start_epoch change number of SRResNet training iterations in the previous round.
  • line 48: resume change to SRResNet weight address that needs to be loaded.

Train SRGAN model

  • line 71: start_epoch change number of SRGAN training iterations in the previous round.
  • line 72: resume change to RRDBNet weight address that needs to be loaded.
  • line 73: resume_d change to Discriminator weight address that needs to be loaded.
  • line 74: resume_g change to Generator weight address that needs to be loaded.

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.

Dataset Scale SRResNet (PSNR) SRGAN (PSNR)
Set5 4 32.05(32.00) 29.40(28.91)
Set14 4 28.49(28.28) 26.02(25.70)

Low resolution / Recovered High Resolution / Ground Truth

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}
}

srgan-pytorch's People

Contributors

lornatang avatar ozturkoktay avatar phelaposcam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.