Skip to content

Wrapper for "SwinIR: Image Restoration Using Swin Transformer", for easy usage as a package.

Notifications You must be signed in to change notification settings

Lin-Sinorodin/SwinIR_wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

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!

About

Wrapper for "SwinIR: Image Restoration Using Swin Transformer", for easy usage as a package.

Topics

Resources

Stars

Watchers

Forks