Models · Monocular depth

Depth Anything V2

Depth Anything V2: relative depth from one image, in small, base and large. The licence differs by size, see the table.

Commercial use: depth-anything-v2-s: yes; depth-anything-v2-b, depth-anything-v2-l: no (weights: CC-BY-NC-4.0).

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
depth-anything-v2-sMiddlebury 2014 half (994x1482)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
53.6
41.0
7.82
4.51
6.65
4.46
407 / 478
373 / 418
249 / 326
190 / 248
201 / 224
186 (engine)
depth-anything-v2-bMiddlebury 2014 half (994x1482)original (fp32)
original
portable
kernels
93.6
63.2
18.8
10.5
858 / 940
928 / 1026
450 / 516
387 / 436
depth-anything-v2-lMiddlebury 2014 half (994x1482)original (fp32)
original
portable
kernels
245
140
55.1
31.1
2109 / 2326
2560 / 2654
1026 / 1352
921 / 1034
Details
  • Original code: https://github.com/DepthAnything/Depth-Anything-V2 at a561b84
  • Code licence: Apache-2.0 (permissive); files: LICENSE
  • Weights licence: Apache-2.0
    • depth-anything-v2-b: CC-BY-NC-4.0
    • depth-anything-v2-l: CC-BY-NC-4.0
  • Licence evidence: https://github.com/DepthAnything/Depth-Anything-V2/blob/main/README.md (LICENSE section) and the Hugging Face model cards
  • Training data: Teacher (ViT-G) on 595K synthetic images (BlendedMVS, Hypersim, IRS, TartanAir, VKITTI 2); students on 62M pseudo-labelled real images (SA-1B, Open Images, BDD100K, Google Landmarks, ImageNet-21K, LSUN, Objects365, Places365) per the paper
  • Licence note: Only the Small weights are Apache-2.0; the Base and Large weights are CC-BY-NC-4.0. The training data of even the Small model has unclear commercial terms (a note only).
  • Options: short_side = 518 (>= 14; also input_size)
  • Kernel libraries: fastbb, dpt_fused
  • Variants: depth-anything-v2-s, depth-anything-v2-b, depth-anything-v2-l
  • Outputs: inverse_depth; kind: affine_invariant_inverse
  • Input size: any H x W >= 8, resized or padded inside the model (ViT patch 14)
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): depth-anything-v2-s 3000x4000 (0.5 GiB peak allocated, 0.5 reserved); depth-anything-v2-b 3000x4000 (0.8 GiB peak allocated, 0.9 reserved); depth-anything-v2-l 3000x4000 (1.8 GiB peak allocated, 2.2 reserved)
  • depth-anything-v2-s 994x1482, first call: portable + torch.compile 16 s (cold Inductor cache), TensorRT fp16 30 s (ONNX + engine).
  • depth-anything-v2-s original 994x1482: torch.autocast(fp16) around the forward
  • depth-anything-v2-b original 994x1482: torch.autocast(fp16) around the forward
  • depth-anything-v2-l original 994x1482: torch.autocast(fp16) around the forward
  • depth-anything-v2-s load / first call: original 0.71 s / 0.38 s, portable 0.11 s / 0.027 s, kernels 0.08† s / 0.009 s
  • depth-anything-v2-b load / first call: original 3.94 s / 0.08 s, portable 0.85 s / 0.019 s, kernels 0.2† s / 0.012 s
  • depth-anything-v2-l load / first call: original 5.66 s / 0.149 s, portable 2.39 s / 0.081 s, kernels 0.91† s / 0.055 s
  • † measured in the speed sweep after the portable load (or an earlier size) in the same process: file cache and kernels are warm, so the time is lower than a fresh start.
  • Protocol, median of 5 after 3 warm-up, uint8 CUDA input (synthetic for bench_inputs sizes), card defaults; gc before each load; peak = max over the first call and the timed calls

Measured

AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Original = the original code named under Details, same checkpoint and protocol.

variantdatasetoriginal fp32original fp16portablekernelsnote
depth-anything-v2-sNYUv2 test, AbsRel / delta10.0509 / 0.97800.0509 / 0.97800.0509 / 0.97800.0509 / 0.9780
depth-anything-v2-siBims-1, AbsRel / delta10.0448 / 0.97440.0448 / 0.97440.0448 / 0.97440.0448 / 0.9744
depth-anything-v2-sETH3D two-view train left, AbsRel / delta10.0803 / 0.92560.0803 / 0.92560.0803 / 0.92560.0803 / 0.9256possibly in the training data
depth-anything-v2-sMiddlebury 2014 trainingH left, AbsRel / delta10.0346 / 0.99470.0346 / 0.99470.0346 / 0.99470.0346 / 0.9947possibly in the training data
depth-anything-v2-bNYUv2 test, AbsRel / delta10.0462 / 0.98060.0462 / 0.98060.0462 / 0.98060.0462 / 0.9806
depth-anything-v2-biBims-1, AbsRel / delta10.0378 / 0.98340.0378 / 0.98340.0378 / 0.98340.0378 / 0.9834
depth-anything-v2-bETH3D two-view train left, AbsRel / delta10.0696 / 0.93690.0698 / 0.93610.0696 / 0.93690.0696 / 0.9372possibly in the training data
depth-anything-v2-bMiddlebury 2014 trainingH left, AbsRel / delta10.0318 / 0.99580.0319 / 0.99570.0318 / 0.99580.0318 / 0.9958possibly in the training data
depth-anything-v2-lNYUv2 test, AbsRel / delta10.0439 / 0.98140.0439 / 0.98140.0439 / 0.98140.0439 / 0.9814
depth-anything-v2-liBims-1, AbsRel / delta10.0347 / 0.98510.0347 / 0.98510.0347 / 0.98510.0347 / 0.9851
depth-anything-v2-lETH3D two-view train left, AbsRel / delta10.0627 / 0.95130.0627 / 0.95130.0627 / 0.95120.0627 / 0.9513possibly in the training data
depth-anything-v2-lMiddlebury 2014 trainingH left, AbsRel / delta10.0296 / 0.99610.0296 / 0.99610.0296 / 0.99610.0296 / 0.9961possibly in the training data

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 468fba10 / 939adfe8, 2026-11-06.

Parity

CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.5 % and p99 <= 2 % of the reference's median |value| (absolute error of the output inverse_depth).

variantkernels error vs original, mean / p99GPU, torchkernels used
depth-anything-v2-s0.00038 / 0.00124RTX 5060 Ti, torch 2.14.1+cu130dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120
depth-anything-v2-b0.00072 / 0.00264RTX 5060 Ti, torch 2.14.1+cu130dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120
depth-anything-v2-l0.00077 / 0.0024RTX 5060 Ti, torch 2.14.1+cu130dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120