Code Monkey home page Code Monkey logo

esrgan_mri's Introduction

ESRGAN-PyTorch

Overview

This repository contains an op-for-op PyTorch reimplementation of ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks.

Table of contents

Download weights

Download datasets

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

How Test and Train

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

Test

  • line 31: upscale_factor change to 4.
  • line 33: mode change to test.
  • line 111: model_path change to results/pretrained_models/RRDBNet_x4-DFO2K-2e2a91f4.pth.tar.

Train RRDBNet model

  • line 31: upscale_factor change to 4.
  • line 33: mode change to train_rrdbnet.
  • line 35: exp_name change to RRDBNet_baseline.

Resume train RRDBNet model

  • line 31: upscale_factor change to 4.
  • line 33: mode change to train_rrdbnet.
  • line 35: exp_name change to RRDBNet_baseline.
  • line 49: resume change to samples/RRDBNet_baseline/g_epoch_xxx.pth.tar.

Train ESRGAN model

  • line 31: upscale_factor change to 4.
  • line 33: mode change to train_esrgan.
  • line 35: exp_name change to ESRGAN_baseline.
  • line 77: resume change to results/RRDBNet_baseline/g_last.pth.tar.

Resume train ESRGAN model

  • line 31: upscale_factor change to 4.
  • line 33: mode change to train_esrgan.
  • line 35: exp_name change to ESRGAN_baseline.
  • line 77: resume change to results/RRDBNet_baseline/g_last.pth.tar.
  • line 78: resume_d change to samples/ESRGAN_baseline/g_epoch_xxx.pth.tar.
  • line 79: resume_g change to samples/ESRGAN_baseline/g_epoch_xxx.pth.tar.

Result

Source of original paper results: https://arxiv.org/pdf/1809.00219v2.pdf

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

Method Scale Set5 (PSNR/SSIM) Set14 (PSNR/SSIM) BSD100 (PSNR/SSIM) Urban100 (PSNR/SSIM) Manga109 (PSNR/SSIM)
RRDB 4 32.73(32.71)/0.9011(0.9018) 28.99(28.96)/0.7917(0.7917) 27.85(27.85)/0.7455(0.7473) 28.03(28.03)/0.8153(0.8156) 31.66(31.60)/0.9196(0.9195)
ESRGAN 4 -(30.44)/-(0.8525) -(26.28)/-(0.6994) -(25.33)/-(0.6534) -(24.36)/-(0.7341) -(29.42)/-(0.8597)
# Download `ESRGAN_x4-DFO2K-25393df7.pth.tar` weights to `./results/pretrained_models`
# More detail see `README.md<Download weights>`
python ./inference.py --inputs_path ./figure/baboon_lr.png --output_path ./figure/baboon_sr.png --weights_path ./results/pretrained_models/ESRGAN_x4-DFO2K-25393df7.pth.tar

Input:

Output:

Build ESRGAN model successfully.
Load ESRGAN model weights `./results/pretrained_models/ESRGAN_x4-DFO2K-25393df7.pth.tar` successfully.
SR image save to `./figure/baboon_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

ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks

Xintao Wang, Ke Yu, Shixiang Wu, Jinjin Gu, Yihao Liu, Chao Dong, Chen Change Loy, Yu Qiao, Xiaoou Tang

Abstract
The Super-Resolution Generative Adversarial Network (SRGAN) is a seminal work that is capable of generating realistic textures during single image super-resolution. However, the hallucinated details are often accompanied with unpleasant artifacts. To further enhance the visual quality, we thoroughly study three key components of SRGAN - network architecture, adversarial loss and perceptual loss, and improve each of them to derive an Enhanced SRGAN (ESRGAN). In particular, we introduce the Residual-in-Residual Dense Block (RRDB) without batch normalization as the basic network building unit. Moreover, we borrow the idea from relativistic GAN to let the discriminator predict relative realness instead of the absolute value. Finally, we improve the perceptual loss by using the features before activation, which could provide stronger supervision for brightness consistency and texture recovery. Benefiting from these improvements, the proposed ESRGAN achieves consistently better visual quality with more realistic and natural textures than SRGAN and won the first place in the PIRM2018-SR Challenge. The code is available at this https URL.

[Paper] [Author's implements(PyTorch)]

@misc{wang2018esrgan,
    title={ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks},
    author={Xintao Wang and Ke Yu and Shixiang Wu and Jinjin Gu and Yihao Liu and Chao Dong and Chen Change Loy and Yu Qiao and Xiaoou Tang},
    year={2018},
    eprint={1809.00219},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

esrgan_mri's People

Contributors

mamata-s avatar

Watchers

 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.