Metric3D

Yin 2023 · Paper

One-line summary — Zero-shot metric monocular depth across thousands of different cameras, achieved by transforming every training image (or its label) into a canonical camera space that removes the focal-length ambiguity.

Problem

Single-image metric depth is trapped between two failure modes. State-of-the-art metric models can only handle a single camera model and cannot train on mixed data because of metric ambiguity: from a pinhole projection, an object of real size S^\hat{S} imaged at size S^\hat{S}' satisfies

da=S^f^S^=S^αd_a = \hat{S}\,\frac{\hat{f}}{\hat{S}'} = \hat{S}\cdot\alpha

so the same pixel pattern corresponds to different metric depths under different focal lengths f^\hat{f} (sensor and pixel size, by contrast, are shown not to matter). Models trained on large mixed datasets (MiDaS-style) achieve zero-shot generalization only by retreating to affine-invariant depth, which cannot recover real-world scale. Metric3D shows that the key to a zero-shot metric model is combining large-scale mixed-data training with an explicit resolution of this camera ambiguity.

Method & architecture

Canonical camera space transformation (CSTM). Fix a canonical focal length fcf^c and transform all training data as if captured by that camera, in one of two equivalent ways:

A random crop follows (it only changes FOV and optical center, not the metric). The network Nd\mathcal{N}_d is trained in canonical space, minθNd(Ic,θ)Dc\min_\theta \left|\mathcal{N}_d(\mathbf{I}_c, \theta) - \mathbf{D}^*_c\right|, and at inference a de-canonicalization converts the prediction back to the real camera — e.g. D=1ωdDc\mathbf{D} = \frac{1}{\omega_d}\mathbf{D}_c for CSTM_label. Only the focal length is needed at test time; the module plugs into any existing monocular depth model.

Random proposal normalization loss (RPNL). Whole-image scale-shift normalization squeezes fine-grained local depth contrast, so M=32M=32 patches pip_i (0.125–0.5 of image size) are randomly cropped and each is normalized by median absolute deviation before an L1 comparison:

LRPNL=1MNpiMjNdpi,jμ(dpi,j)1Njdpi,jμ(dpi,j)dpi,jμ(dpi,j)1Njdpi,jμ(dpi,j)L_{RPNL} = \frac{1}{MN}\sum_{p_i}^{M}\sum_{j}^{N}\left|\frac{d^*_{p_i,j}-\mu(d^*_{p_i,j})}{\frac{1}{N}\sum_j |d^*_{p_i,j}-\mu(d^*_{p_i,j})|} - \frac{d_{p_i,j}-\mu(d_{p_i,j})}{\frac{1}{N}\sum_j |d_{p_i,j}-\mu(d_{p_i,j})|}\right|

with μ()\mu(\cdot) the median. The overall loss is L=LPWN+LVNL+Lsilog+LRPNLL = L_{PWN} + L_{VNL} + L_{silog} + L_{RPNL} (pair-wise normal regression, virtual normal, scale-invariant log, plus RPNL).

Backbone and training. A UNet with a ConvNeXt-Large encoder (ImageNet-22K initialized), trained on 11 public RGB-D datasets — over 8M images spanning more than 10K cameras, all with known intrinsics — balanced per mini-batch, at 512×960512\times 960 crops, 500K iterations on 48 A100 GPUs. Without CSTM the same model fails to converge on mixed metric data; encoding intrinsics as extra input channels (CamConvs) trains but performs clearly worse.

Results

Metric3D achieves state-of-the-art performance on 7 zero-shot benchmarks and won the 2nd Monocular Depth Estimation Challenge. Zero-shot (never trained on either dataset), CSTM_label reaches δ1\delta_1 0.944 / AbsRel 0.083 on NYUv2 and δ1\delta_1 0.964 / AbsRel 0.058 on KITTI — comparable to fully supervised in-domain SOTA (NeWCRFs: 0.922 / 0.095 and 0.974 / 0.052). Metric point clouds from single images enable metrology in the wild on Flickr photos with only metadata intrinsics. For SLAM, naively feeding its metric depth to Droid-SLAM on KITTI odometry slashes translational drift trelt_{rel}: Seq 00 from 33.9 to 1.44, Seq 02 from 34.88 to 2.64, Seq 05 from 23.4 to 1.44, Seq 09 from 21.7 to 1.63 — far below ORB-SLAM2 (e.g. 11.43 on Seq 00) — while also enabling metric-scale dense mapping; gains on the small indoor ETH3D SLAM scenes are smaller.

Why it matters for SLAM

SLAM needs metric depth — relative depth cannot anchor scale for monocular systems or feed metric map fusion. Metric3D’s canonical-camera normalization became the standard recipe for camera-agnostic metric depth (adopted by UniDepth, Depth Pro, and others; Metric3D v2 added a ViT backbone and surface normals) and enables plug-and-play depth priors for whatever camera your robot happens to carry, without per-camera fine-tuning. Its own experiments show the payoff directly: a monocular SLAM system with its depth behaves like RGB-D SLAM, with scale drift largely eliminated.