All models

DPT_Hybrid (MiDaS)

A depth-estimation network that feeds ResNet50 features into a vision transformer and decodes with convolutions.

Depth estimation · 182 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 (15 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
264.3K
Operations
182
Framework
PyTorch
Recurrent
No
Published
ICCV (arXiv 2021)
Authors
René Ranftl, Alexey Bochkovskiy, Vladlen Koltun
Name in source
midas:DPT_Hybrid
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
m5849
Graph hash
36e7a26603d23c735822314fdf2cd3b719eba10b3b822cc9d76a78c67405f92e
Skeleton hash
9fd858d76cec9df43e295e8a4fa03a8186a21256bbd6b9b0497b16ef4ef83b95
Architecture hash
ebf3b8719ecef67c6afac85f17cb33c232b95f1c73839c91505e04977447ae99
Diagram SHA-256
19c415d64de4a70cc7cb8e9a51c0f5ba88493464ced4bc3d52a36d4515a45f28
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.depth_anything_dpt:build_hybrid: build({})

What it is

DPT-Hybrid is a dense prediction transformer (DPT): a network that makes a prediction for every pixel of an image, here a depth estimate from a single photo, with a transformer as the basic building block of its encoder. The paper's case for the design is that a transformer backbone processes representations at a constant and relatively high resolution and has a global receptive field at every stage.

In the paper, the hybrid encoder uses a ResNet50 to compute the image embedding, followed by 12 transformer layers. Features are read out at four stages and four resolutions: from the first and second ResNet blocks and from transformer layers 9 and 12. A convolutional decoder then combines consecutive stages with RefineNet-based fusion blocks, upsampling by a factor of two at each one, so the final representation has half the resolution of the input image.

For depth, the paper trains on a meta-dataset it calls MIX 6, which contains about 1.4 million images, using a scale- and shift-invariant trimmed loss on inverse depth. In zero-shot transfer to datasets not seen during training, the paper reports an average relative improvement over MiDaS, which it calls the best published architecture, of more than 23% for DPT-Hybrid and 28% for DPT-Large. It lists DPT-Hybrid at 123 million parameters and describes its network capacity as comparable to that of MiDaS.

Key idea. DPT replaces the convolutional backbone of dense prediction networks with a vision transformer and reassembles its tokens into multi-resolution feature maps for a convolutional decoder.

  • dpt-hybrid
  • dpt hybrid
  • midas dpt_hybrid
  • dense prediction transformer
  • vision transformers for dense prediction
  • monocular depth estimation
  • vit-hybrid
  • depth estimation transformer
  • midas v3

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