Giter Site home page Giter Site logo

swinir_wrapper's Introduction

Wrapper for SwinIR

Based on this repository - the official PyTorch implementation of SwinIR: Image Restoration Using Swin Transformer.

About SwinIR and this repository:

  • SwinIR achieves state-of-the-art performance on six tasks: image super-resolution (including classical, lightweight and real-world image super-resolution), image denoising (including grayscale and color image denoising) and JPEG compression artifact reduction.
  • This repository only provides usage of the 3 image super-resolution tasks from SwinIR at the moment.
  • SwinIR.py is a minimal wrapper for the super resolution model, making it easy to use as a part from a bigger pipeline.
  • Only enables the usage of the pretrained weights from the model zoo. For training, see the official repo.
  • Uses the PyTorch model network_swinir.py from the official repo (unchanged).

How to Use

  • For easy usage on your own data, see Demo.ipynb. This notebook will be displayed best using Google Colab which supports more interactive usage:
Open In Colab
  • As a quick preview, this example demonstrates usage with only few lines:
    import cv2
    from SwinIR_wrapper import SwinIR_SR
    
    # initialize super resolution model
    sr = SwinIR_SR(model_type='real_sr', scale=4)
    
    # load low quality image
    img_lq = cv2.imread(path, cv2.IMREAD_COLOR)
    
    # feed the image to the SR model
    img_hq = sr.upscale(img_lq)

License and Acknowledgement

Please follow the license of the official repo of this paper. Thanks for their great work!

swinir_wrapper's People

Contributors

lin-sinorodin avatar

Stargazers

musicrainie avatar  avatar max-fofanov avatar GD Studio avatar  avatar  avatar George Pied avatar  avatar jacob avatar

Watchers

 avatar

swinir_wrapper's Issues

[REQ] HINet wrapper

Hi there, 1st of all thanks for your work, your wrapper is very clean and usable.

If you're interested can you build something similar for HINet: Half Instance Normalization Network for Image Restoration ?

With the help of HIN Block, HINet surpasses the state-of-the-art (SOTA) on various image restoration tasks. For image denoising, we exceed it 0.11dB and 0.28 dB in PSNR on SIDD dataset, with only 7.5% and 30% of its multiplier-accumulator operations (MACs), 6.8 times and 2.9 times speedup respectively. For image deblurring, we get comparable performance with 22.5% of its MACs and 3.3 times speedup on REDS and GoPro datasets. For image deraining, we exceed it by 0.3 dB in PSNR on the average result of multiple datasets with 1.4 times speedup.

Some "real-world" tests by Selur:

Mode: Deblur GoPro

Mode: Deblur REDS

Mode: denoise

Mode: derain

Hope that inspires !

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.