jingyunliang / swinir

Image Restoration Using Swin Transformer

  • Public
  • 5.9M runs
  • A100 (80GB)
  • GitHub
  • Paper
  • License

Input

image
*file

input image

string

Choose a task

Default: "Real-World Image Super-Resolution-Large"

integer

noise level, activated for Grayscale Image Denoising and Color Image Denoising. Leave it as default or arbitrary if other tasks are selected

Default: 15

integer

scale factor, activated for JPEG Compression Artifact Reduction. Leave it as default or arbitrary if other tasks are selected

Default: 40

Output

We were unable to load these images. Please make sure the URLs are valid.

{
  "input": "https://replicate.delivery/mgxm/efd1b6b0-4d79-4a42-ab31-2dcd29754a2d/chip.png",
  "outut": "https://replicate.delivery/mgxm/1e3c0b87-01a7-4795-abac-aaf17479cf84/out.png"
}

This example was created by a different version, jingyunliang/swinir:a6655af5.

Run time and cost

This model costs approximately $0.019 to run on Replicate, or 52 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.

This model runs on Nvidia A100 (80GB) GPU hardware. Predictions typically complete within 14 seconds. The predict time for this model varies significantly based on the inputs.

Readme

SwinIR: Image Restoration Using Swin Transformer

This repository is the official PyTorch implementation of SwinIR: Image Restoration Using Shifted Window Transformer (arxiv, supp). SwinIR ahcieves state-of-the-art performance in - bicubic/lighweight/real-world image SR - grayscale/color image denoising - JPEG compression artifact reduction



Image restoration is a long-standing low-level vision problem that aims to restore high-quality images from low-quality images (e.g., downscaled, noisy and compressed images). While state-of-the-art image restoration methods are based on convolutional neural networks, few attempts have been made with Transformers which show impressive performance on high-level vision tasks. In this paper, we propose a strong baseline model SwinIR for image restoration based on the Swin Transformer. SwinIR consists of three parts: shallow feature extraction, deep feature extraction and high-quality image reconstruction. In particular, the deep feature extraction module is composed of several residual Swin Transformer blocks (RSTB), each of which has several Swin Transformer layers together with a residual connection. We conduct experiments on three representative 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. Experimental results demonstrate that SwinIR outperforms state-of-the-art methods on different tasks by up to 0.14~0.45dB, while the total number of parameters can be reduced by up to 67%.

Citation

@article{liang2021swinir,
    title={SwinIR: Image Restoration Using Swin Transformer},
    author={Liang, Jingyun and Cao, Jiezhang and Sun, Guolei and Zhang, Kai and Van Gool, Luc and Timofte, Radu},
    journal={arXiv preprint arXiv:2108.10257}, 
    year={2021}
}