All models

DPT_SwinV2_T_256 (MiDaS)

MiDaS DPTDepthModel, the SwinV2-T 256 build: a transformer backbone with a convolutional depth decoder.

Depth estimation · 180 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 (13 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

Parameters
318.7K
Operations
180
Framework
PyTorch
Recurrent
No
Published
ICCV (arXiv 2021)
Cited by
2,364 (as of 29 October 2026)
Authors
René Ranftl, Alexey Bochkovskiy, Vladlen Koltun
Name in source
midas:DPT_SwinV2_T_256
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
m12007
Graph hash
a2d1b7b5e9442869fcf9f4c461e8f10a953cfa654a1c404b52c8497d6bf05c0c
Skeleton hash
46e70b8e279afba5d1189e6285bfd408986a5915cb5033768edca616fab407f9
Architecture hash
54e6979daac360b20a31a84092fa1b488e0701023c46490f24bb99c4ac01a9fc
Diagram SHA-256
5d6b8955ee998e0016391162b60ffd0a26aaed9fe48c04192822a0f7efad4771
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.depth_anything_dpt:build_vitl: build({})

What it is

About this model's family

This is a DPT depth model: the dense prediction transformer that uses a vision transformer in place of a convolutional network as the backbone and a convolutional decoder to produce the dense output. Monocular depth estimation is cast as a dense regression problem, so the network emits one depth value per pixel. The authors picked this task deliberately: transformers are known to realize their full potential only when an abundance of training data is available, and large depth meta-datasets can be built from existing sources.

The backbone processes representations at a constant and relatively high resolution and has a global receptive field at every stage, which the paper credits for finer-grained and more globally coherent predictions than fully-convolutional networks give. The decoder reassembles tokens from four different stages at four different resolutions, deeper layers at lower resolution. RefineNet-based fusion blocks then upsample by a factor of two per stage until the representation has half the resolution of the input image, and a task-specific head produces the final depth map.

Training follows the MiDaS protocol with a scale- and shift-invariant trimmed loss on inverse depth plus a gradient-matching loss. The training set, MIX 6, holds about 1.4 million images. In zero-shot cross-dataset transfer the average relative improvement over MiDaS is more than 23% for DPT-Hybrid and 28% for DPT-Large, and the ResNext101-WSL baseline in the backbone ablation corresponds to the original MiDaS architecture. Both DPT variants also keep similar latency to MiDaS even though DPT-Large is about 3 times larger.

Key idea. Assembling tokens from several stages of a vision transformer into image-like representations at several resolutions and fusing them with a convolutional decoder into a full-resolution depth prediction.

  • MiDaS
  • DPT
  • DPTDepthModel
  • dense prediction transformer
  • Vision Transformers for Dense Prediction
  • monocular depth estimation
  • relative depth
  • inverse depth
  • depth map
  • DPT_SwinV2_T_256
  • SwinV2-T
  • MiDaS DPT SwinV2

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

Cite the paper

@misc{ranftl2021visiontransformersdenseprediction,
      title={Vision Transformers for Dense Prediction}, 
      author={René Ranftl and Alexey Bochkovskiy and Vladlen Koltun},
      year={2021},
      eprint={2103.13413},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2103.13413}, 
}