model-insights · Depth Anything V2 Small · synthetic scenes + 62M pseudo-labelled photos

Inside a depth model

A single photo has no depth in it: every pixel is just a colour. Yet a model can look at one image and say, for every pixel, how far away it is. It can only do that by assuming things about the world: that the ground recedes, that the sky is far, that the light comes from above. Those assumptions came from its training images. This page measures them.

Loading model weights…

1 A vision transformer with a depth head

Depth Anything V2 Small has 24.8 million parameters in two parts. The encoder is DINOv2 ViT-S/14, a vision transformer pre-trained without labels. It cuts the 518×392 image into 1,036 patches of 14×14 pixels, adds a class token, and passes all 1,037 tokens through 12 layers of self-attention (6 heads, 384 numbers per token). The decoder is DPT. It takes the tokens after layers 3, 6, 9 and 12, rearranges each set back into a grid, resizes them to four resolutions, and fuses them from coarse to fine into one value per pixel.

That value is relative inverse depth: larger means nearer, and 0 means infinitely far. It has no unit. A photo can't tell you whether you're looking at a room or a doll's house, so only the ordering and the proportions mean anything.

The training recipe matters for everything below. According to the paper, a large teacher model learned depth only from about 595,000 synthetic images, rendered scenes with perfect depth: indoor rooms (Hypersim), city driving (Virtual KITTI 2), objects and landscapes (BlendedMVS), indoor robotics scenes (IRS) and simulated environments (TartanAir). The teacher then labelled 62 million real photos (ImageNet-21K, Places365, Open Images, SA-1B, driving and landmark collections), and this small student learned only from those labels. In training, sky is set to "infinitely far" by convention.

Layer by layer

2 See what it sees

Pick, drop or paste an image, or use the webcam and press Live. Switch views on the right. In the 3D view, drag to turn the scene. Click on the image to choose a spot. The page then shows where every layer's attention goes from that patch, and which pixels decide the depth there.

drop / paste · click a spot

Where each layer looks from the chosen patch (attention, averaged over the 6 heads)

Click on the image to choose a patch.

3 What it assumes

To see the assumptions, take away the scene, or keep the scene and break one of its habits. All depth maps below use the same colours: bright is near, black is far.

The sky is up, and infinitely far

Upside down

A picture is a window

4 What "near" and "far" look like to it

Start from noise and change the pixels so that the centre of the image comes out as near as possible compared with the border, or as far as possible.