All models

SETR_PUP

A pure transformer encoder that segments images as patch sequences, with three decoder designs.

Segmentation · 188 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

Loading diagram (28 KB)

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

Family
setr
Parameters
254.3K
Operations
188
Framework
PyTorch
Recurrent
No
Published
CVPR (arXiv 2020)
Cited by
3,680 (as of 9 October 2026)
Authors
Sixiao Zheng, Jiachen Lu, Hengshuang Zhao and others
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
m2668
Graph hash
e5f098bc864342d04a618d52504491c2c36257d680ea8e942a2e9f81779a7504
Skeleton hash
2ac8ae67f8edae014b304568b1d8eaf504280eb3599cce151ee2455000d7580d
Architecture hash
7111d61e86fe50ef88c5fd2f5ad6acba323a87f7ad10027855559959b1e1a4ac
Diagram SHA-256
76f75a6443ec35d002c830199c32daf1e577de75b8984e3ab796074c8793e362
TorchLens version
2.35.3
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

menagerie.classics.setr_vit_seg:build_setr_pup: build({})

What it is

SETR-PUP upsamples progressively, alternating convolution layers with 2x upsampling over four steps.

About this model's family

SETR, the SEgmentation TRansformer, treats semantic segmentation as a sequence-to-sequence prediction problem. A pure transformer, with no convolution and no resolution reduction, encodes the image as a sequence of patches. This encoder is then combined with a simple decoder to make the segmentation model. The point is to drop the fully convolutional encoder-decoder design, in which spatial resolution shrinks layer by layer: here there is no downsampling, and global context is modeled at every layer of the encoder.

The image is split into fixed-size patches, each linearly embedded, given a position embedding and fed to a standard Transformer encoder. The paper introduces three decoders of increasing complexity, and all three are captured here: SETR-Naive, SETR-PUP and SETR-MLA. The naive decoder projects the transformer output to the number of categories with two 1 by 1 convolutions and bilinearly upsamples it to full resolution in one step. Progressive upsampling alternates convolutions with 2x upsampling, taking four steps to reach full resolution. Multi-level aggregation fuses features from several transformer layers in the spirit of a feature pyramid network.

The captured members emit 19-channel maps, the category count the paper uses for Cityscapes. SETR reached 50.28% mIoU on ADE20K and 55.83% on Pascal Context, and took first position on the ADE20K test server leaderboard on the day of submission.

Key idea. Reformulating semantic segmentation as sequence-to-sequence learning with a pure transformer encoder that keeps full spatial resolution, as an alternative to the encoder-decoder FCN design.

  • setr
  • segmentation transformer
  • semantic segmentation
  • vision transformer
  • ade20k
  • cityscapes
  • pascal context
  • setr-pup
  • setr-mla
  • setr-naive

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

Cite the paper

@misc{zheng2021rethinkingsemanticsegmentationsequencetosequence,
      title={Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers}, 
      author={Sixiao Zheng and Jiachen Lu and Hengshuang Zhao and Xiatian Zhu and Zekun Luo and Yabiao Wang and Yanwei Fu and Jianfeng Feng and Tao Xiang and Philip H. S. Torr and Li Zhang},
      year={2021},
      eprint={2012.15840},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2012.15840}, 
}