All models

Uformer-inpaint

A U-shaped Transformer for image restoration built from locally-enhanced window (LeWin) attention blocks.

Diffusion and generative · 2,963 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

This diagram has 2,963 operations (40 KB) and is drawn when you ask.

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
50.9M
Operations
2,963
Framework
PyTorch
Recurrent
No
Published
CVPR 2022
Cited by
2,417 (as of 27 October 2026)
Authors
Zhendong Wang, Xiaodong Cun, Jianmin Bao and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m21164
Graph hash
62bafb341a8fb075020dff69fcb54de9901c8aee444595cbe1246bb6d28d31f2
Skeleton hash
23536318b1248ab25112c3239ee7441caf06d23bb0b85aa507f440293f34379e
Architecture hash
55003d448699474d5db3f5202496b54d75c53fcf8a140d397afe50f82b35756e
Diagram SHA-256
afd8a1be8cae9c3cf07576e1f6e3f7b2a261b50a3f51eed7576176bdf3ef2f88
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This model is built as Uformer_B, the size for which the repository links pretrained SIDD and GoPro models.

Uformer is a Transformer-based architecture for image restoration, built as a hierarchical encoder-decoder network out of Transformer blocks. The paper names two core designs.

The first is the locally-enhanced window (LeWin) Transformer block, which performs non-overlapping window-based self-attention instead of global self-attention. This reduces the computational complexity on high-resolution feature maps while capturing local context, and the block also uses depth-wise convolution in its feed-forward network. The second is a learnable multi-scale restoration modulator, a multi-scale spatial bias that adjusts features in multiple layers of the Uformer decoder. According to the paper, the modulator adds only marginal extra parameters and computational cost.

The paper's experiments cover image denoising, motion deblurring, defocus deblurring and deraining. The repository provides results on SIDD and DND for denoising, on GoPro, HIDE and RealBlur for motion deblurring, and on DPDD for defocus deblurring. Its code acknowledges borrowing heavily from MIRNet and SwinTransformer.

Key idea. Uformer builds a hierarchical encoder-decoder for image restoration from locally-enhanced window Transformer blocks and adds a learnable multi-scale restoration modulator to the decoder.

  • uformer
  • uformer-inpaint
  • uformer_b32
  • uformer_tiny_b16
  • u-shaped transformer
  • lewin transformer
  • image restoration
  • image denoising
  • image deblurring
  • deraining

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{wang2021uformergeneralushapedtransformer,
      title={Uformer: A General U-Shaped Transformer for Image Restoration}, 
      author={Zhendong Wang and Xiaodong Cun and Jianmin Bao and Wengang Zhou and Jianzhuang Liu and Houqiang Li},
      year={2021},
      eprint={2106.03106},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2106.03106}, 
}