All models

SETR_Naive

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

Segmentation · 176 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 (25 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
217.9K
Operations
176
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
m2667
Graph hash
781385f91adc4498aa45fc73501bc5da912ba1aea0fec48886f161630e6db1e1
Skeleton hash
b4f66e850f3dda5f737a855bb0fb7111d82250445a5bc1646ebecb6cb5fde17d
Architecture hash
f74952f6deaf03331c2542276a2fd5f1fbb2901ca8372633312ebcab8d5873db
Diagram SHA-256
17ca8c870f12e275ae71f2324cb6071b1316f459260173126b38363012a8fc26
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

How this diagram was made

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

What it is

SETR-Naive projects the transformer feature to the category count with a two-layer 1 by 1 convolutional network and bilinearly upsamples the result to the full image resolution.

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}, 
}