Giter Club home page Giter Club logo

msrn-rcan-srgan's Introduction

MSRN-RCAN-SRGAN

Overview

This repository contains a simple PyTorch implementation of 4x SRGAN combined with EDSR, RCAN, MSRN.

Now CPU/OneGPU/DDP versions have been implemented, you can use it freely with bash

Model

MSCARB

MSCARN

Discriminator

Prerequisites

  1. Linux version 3.10.0-693.el7.x86_64
  2. Python 3.8.15
  3. Pytorch 1.12.0
  4. CUDA Toolkit 11.6
  5. cuDNN 8302

Download Weights

Pretrained weight for CNN and GAN also offer Google Drive

How to train

  1. prepare the dataset DIV2K in whatever directory you want, and assign to args in train.py/pretrain.sh
  2. assign the model out path as above too
  3. input: bash pretrain.sh
  4. if you want to monitor the training, input: bash tensorboard.sh after you assign the model out paht in bash

How to test

  1. use test.ipynb in MyNet.code, the example has been offered

Dateset Settings:

  1. The function torchvision.transforms.Resize used for downsample is not bicubic by default, but has been change to Bicubic now
  2. Training and Validating Dateset is DIV2K
  3. Data augmentation: random crop -> random rotation in 90 * k degree/flipping, you can change it in MyNet.code.dataset.py

Train Settings:

  1. You can assgin your own lr_scheduler in net.solver.init
  2. Train on RGB, but validate on Y. However, validate on RGB is also offer in MyNet.code.net.solver.test
  3. D_train require d_real_loss and d_fake_loss more than 0.4 to aviod D too strong, you can change the value in train.py's D_threshold !!!
  4. Hyper parameter K in GAN is not supported(default==1) because it is useless in practice, you have to recode net.solver.run/run_resume if you want
  5. pretrain G with 1e-4 lr for 2000 times, and then 1e-5 lr for 18000 times
  6. run G and D with 1e-5 lr for 10000 times
  7. the more iteration you train in pretrain and run, the better G is, if you want know more, read about SRGAN or ESRGAN

Test Settings:

  1. PSNR and SSIM calculations are only on the y channel
  2. Use float32 for PSNR calculation and uint8 for SSIM calculation

Performance in PSNR/SSIM

Model Set5 Set14 BSD100
Bicubic 28.42/0.8223 25.95/0.7246 25.97/0.6862
SRCNN 30.07/0.8627 27.18/0.7861 26.68/0.7291
SRGAN 29.40/0.8472 26.02/0.7397 25.16/0.6688
ESRGAN 30.39/0.8641 26.20/0.7211 25.35/0.6732
MSCARN(Ours) 32.00/0.9019 28.36/0.8003 27.59/0.7550
MSCAR-GAN(Ours) 31.00/0.8762 27.64/0.7636 26.78/0.7106

Result

baby baboon commic

Contributing

Please feel free to contribute to the project, I am pleasured to answer any questions

Acknowledgements

This code is built on SRGAN (PyTorch). Thank a lot to the authors for sharing codes!

msrn-rcan-srgan's People

Contributors

diouo avatar

Stargazers

 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.