Depth Anything V2
Depth Anything V2: relative depth from one image, in small, base and large. The licence differs by size, see the table.
stable Fork of DepthAnything/Depth-Anything-V2@a561b84 · backends: portable, kernels
- Paper Depth Anything V2 NeurIPS 2024 · first released 13 Jun 2024
Paper 2024 Added in 0.1.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import depth
model = depth.load("depth-anything-v2-s") # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.inverse_depth # also: depth
result.backend # what ran: mode, device, dtype, kernels fastforks bench depth-anything-v2-s Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 53.6 | 0.76× | 407 MiB/478 MiB | 0.3 | 0.22 |
| Original fp16torch.autocast(fp16) around the forward | fp16 | 41.0 | – | 373 MiB/418 MiB | 0.7 | 0.38 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 7.82 | 5.2× | 249 MiB/326 MiB | 0.1 | 0.03 |
| Kernels | fp16 | 4.51 | 9.1× | 190 MiB/248 MiB | 0.1 | 0.01 |
| Portable + torch.compile | 6.65 | 6.2× | 201 MiB/224 MiB | 16 (build) | – | |
| TensorRT fp16 | fp16 | 4.46 | 9.2× | 186 MiBenginenot comparable | 30 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-01 to 2026-11-03. 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. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14 | Original | fp32 | 113 | 1,860 MiB process | matches | 994x1482 |
| Portable | fp16 | 80.7 | 1,575 MiB process | matches | 994x1482 | |
| Portable | fp32 | 87.3 | 1,522 MiB process | matches | 994x1482 | |
| Kernels | fp16 | not implemented | – | 994x1482 | ||
| NVIDIA L4 CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 9.25 | 220 MiB/268 MiB | – | 994x1482 |
| Kernels | fp16 | 5.92 | 153 MiB/208 MiB | – | 994x1482 | |
| NVIDIA L40S CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 3.75 | 220 MiB/268 MiB | – | 994x1482 |
| Kernels | fp16 | 2.24 | 153 MiB/208 MiB | – | 994x1482 | |
| NVIDIA A10 CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 7.99 | 220 MiB/266 MiB | – | 994x1482 |
| Kernels | fp16 | 5.43 | 153 MiB/208 MiB | – | 994x1482 | |
| NVIDIA A100-SXM4-40GB CUDA, torch 2.14.1+cu130, 2026-11-08 | Portable | fp16 | 7.17 | 220 MiB/268 MiB | – | 994x1482 |
| Kernels | fp16 | 4.63 | 153 MiB/208 MiB | – | 994x1482 | |
| NVIDIA RTX PRO 6000 CUDA, torch 2.14.1+cu130, 2026-11-08 | Portable | fp16 | 2.23 | 244 MiB/288 MiB | – | 994x1482 |
| Kernels | fp16 | 2.02 | 153 MiB/208 MiB | – | 994x1482 | |
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Commercial use allowed
- Code
- Apache-2.0 LICENSE
- Weights
- Apache-2.0 source
- 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
- 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).
- The six metric checkpoints are Apache-2.0 on their Hugging Face cards, but the Base / Large ones are fine-tuned from the CC-BY-NC-4.0 relative Base / Large weights, and Virtual KITTI 2 (the outdoor fine-tune) is CC BY-NC-SA 3.0, Hypersim CC BY-SA 3.0.
- Distill-Any-Depth: Apache-2.0 on the Hugging Face card (the authors' transformers ports say MIT, the code is MIT). The paper initialises the Large model from the CC-BY-NC-4.0 Depth Anything V2 Large weights; its teachers include Depth Anything V2 and it trains on unlabeled SA-1B images (research licence).
Our reading of the licences, not legal advice.
Weights
depth_anything_v2_vits.pth 99.2 MB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download depth-anything-v2-s).
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
NYUv2 test
AbsRel / delta1
| Run | dtype | AbsRel ↓ | δ1 ↑ | Δ AbsRel vs fp32 original | images | ms / image |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 0.0509 | 0.9780 | reference | 654 | 41.7 |
| Original fp16 | fp16 | 0.0509 | 0.9780 | ±0.0000 | 654 | 27.5 |
| Portable fp32 | fp32 | 0.0509 | 0.9780 | ±0.0000 | 654 | 22.1 |
| Portable | fp16 | 0.0509 | 0.9780 | ±0.0000 | 654 | 7.00 |
| Kernels | fp16 | 0.0509 | 0.9780 | ±0.0000 | 654 | 3.96 |
AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-06; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6d3bab64, 2026-11-17; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.
iBims-1
AbsRel / delta1
| Run | dtype | AbsRel ↓ | δ1 ↑ | Δ AbsRel vs fp32 original | images | ms / image |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 0.0448 | 0.9744 | reference | 100 | 39.9 |
| Original fp16 | fp16 | 0.0448 | 0.9744 | ±0.0000 | 100 | 26.8 |
| Portable fp32 | fp32 | 0.0448 | 0.9744 | ±0.0000 | 100 | 21.9 |
| Portable | fp16 | 0.0448 | 0.9744 | ±0.0000 | 100 | 7.15 |
| Kernels | fp16 | 0.0448 | 0.9744 | ±0.0000 | 100 | 3.95 |
AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-06; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6d3bab64, 2026-11-17; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.
ETH3D two-view train left
AbsRel / delta1training data not stated: possibly seen
| Run | dtype | AbsRel ↓ | δ1 ↑ | Δ AbsRel vs fp32 original | images | ms / image |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 0.0803 | 0.9256 | reference | 27 | 61.1 |
| Original fp16 | fp16 | 0.0803 | 0.9256 | ±0.0000 | 27 | 49.4 |
| Portable fp32 | not measured | |||||
| Portable | fp16 | 0.0803 | 0.9256 | ±0.0000 | 27 | 11.3 |
| Kernels | fp16 | 0.0803 | 0.9256 | ±0.0000 | 27 | 5.34 |
AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-06; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.
Middlebury 2014 trainingH left
AbsRel / delta1training data not stated: possibly seen
| Run | dtype | AbsRel ↓ | δ1 ↑ | Δ AbsRel vs fp32 original | images | ms / image |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 0.0346 | 0.9947 | reference | 15 | 77.5 |
| Original fp16 | fp16 | 0.0346 | 0.9947 | ±0.0000 | 15 | 67.4 |
| Portable fp32 | not measured | |||||
| Portable | fp16 | 0.0346 | 0.9947 | ±0.0000 | 15 | 12.1 |
| Kernels | fp16 | 0.0346 | 0.9947 | ±0.0000 | 15 | 4.79 |
AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-06; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. 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).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.002 (relative) | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.005 (relative) | 0.00038 (relative) |
| GPU default dtypes, p99 |diff| | ≤ 0.02 (relative) | 0.00124 (relative) |
Recorded for depth-anything-v2-s on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-07, with these kernels: dpt_fusedfastbb
Details
Depth Anything V2 (Yang et al. 2024): relative monocular depth from a DINOv2 ViT encoder and a DPT head, trained on synthetic labels and 62M pseudo-labelled real images; with the authors' metric fine-tunes (Hypersim indoor, Virtual KITTI 2 outdoor) and the Distill-Any-Depth checkpoints (He et al. 2025) of the same network.
- Input / output
- Input: one RGB image. Output: a depth or inverse-depth map.
What the numbers mean, and which models need the camera focal length
kind(a card field,result.kind) says what the numbers mean:metric= metres;scale_invariant,affine_invariant,affine_invariant_log(log depth) andaffine_invariant_inverseare relative (unknown scale or shift, not metres). Metric models that use the focal length takemodel(image, intrinsics=K)(K[3, 3], pixels of the input):metric3d-vit-largeandda3metric-largeneed it for correct metres (da3metric-large: metres = output x focal / 300; withoutintrinsics=a 300 px focal length is assumed, wrong for a real camera).unidepth-v2-vitl14,unik3d-vitl,depth-proand MoGe estimate the camera themselves (givenintrinsics=replacefx);zoedepth-nkand the relative models (da3mono-largetoo) take none. Normals-only models (kindnone) returnresult.normals[B, H, W, 3](unit vectors, camera frame: x right, y down, z forward). - Input size
- any H x W >= 8, resized or padded inside the model (ViT patch 14); tested up to 3000x4000 (509 MiB allocated)
- Options
short_side=518>= 14· changes the output
- Outputs
inverse_depth,depth- Checkpoint
arch="vits"- CUDA kernels
fastbbfast backbone kernels: flash attention, window attention, instance norm and rotary embeddings for ViT and similar backbonesdpt_fusedfused fp16 matrix multiplies and convolutions for DINOv2 backbones and DPT depth heads
- Apple (MPS)
- fp32, fp16
Limitations
- Metric checkpoints predict at most max_depth (20 m Hypersim, 80 m Virtual KITTI 2): the head is a sigmoid scaled by it. Each was fine-tuned on one synthetic domain, so indoor / outdoor scenes outside it get a wrong scale.
- Distill-Any-Depth runs with this family's pipeline (short side 518, aspect kept, as the authors' transformers ports); the authors' demo squashes to 700 x 700. Their Dav2-Teacher-Large-2w-iter checkpoint is not included.
Full reference, generated from the repository
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, depth-anything-v2-metric-hypersim-s, depth-anything-v2-metric-hypersim-b, depth-anything-v2-metric-hypersim-l, depth-anything-v2-metric-vkitti-s, depth-anything-v2-metric-vkitti-b, depth-anything-v2-metric-vkitti-l, distill-any-depth-s, distill-any-depth-b, distill-any-depth-l: yes; depth-anything-v2-b, depth-anything-v2-l: no (weights: CC-BY-NC-4.0).
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
depth-anything-v2-s | Middlebury 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 273 / 308 |
depth-anything-v2-b | Middlebury 2014 half (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 93.6 63.2 18.8 10.5 17.0 10.9 | 858 / 940 928 / 1026 450 / 516 387 / 436 340 / 394 539 / 596 |
depth-anything-v2-l | Middlebury 2014 half (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 245 140 55.1 31.1 51.7 32.4 | 2109 / 2326 2560 / 2654 1026 / 1352 921 / 1034 850 / 952 1579 / 1634 |
depth-anything-v2-metric-hypersim-s | synthetic (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 53.0 43.6 7.66 4.67 6.67 4.47 | 407 / 478 373 / 418 244 / 288 152 / 208 201 / 224 305 / 348 |
depth-anything-v2-metric-hypersim-b | synthetic (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 91.4 60.7 18.6 10.8 17.0 10.8 | 858 / 960 928 / 1026 445 / 514 349 / 396 340 / 394 539 / 614 |
depth-anything-v2-metric-hypersim-l | synthetic (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 246 141 54.5 31.7 51.3 32.3 | 2109 / 2326 2560 / 2654 1022 / 1092 917 / 1034 850 / 910 1579 / 1634 |
depth-anything-v2-metric-vkitti-s | synthetic (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 46.1 36.0 7.66 4.67 6.68 4.47 | 407 / 498 373 / 418 244 / 288 152 / 208 201 / 224 305 / 348 |
depth-anything-v2-metric-vkitti-b | synthetic (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 90.8 60.6 18.6 10.8 17.0 10.9 | 858 / 960 928 / 1026 445 / 514 349 / 396 340 / 394 539 / 614 |
depth-anything-v2-metric-vkitti-l | synthetic (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 245 141 54.5 31.9 51.3 32.4 | 2109 / 2326 2560 / 2654 1022 / 1092 917 / 1034 850 / 910 1579 / 1634 |
distill-any-depth-s | synthetic (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 45.3 35.2 7.65 4.63 6.67 4.46 | 407 / 498 373 / 418 244 / 288 152 / 208 201 / 224 305 / 348 |
distill-any-depth-b | synthetic (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 90.5 59.8 18.6 10.8 17.0 10.8 | 858 / 960 928 / 1026 445 / 514 349 / 396 340 / 394 539 / 614 |
distill-any-depth-l | synthetic (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 244 139 54.4 31.8 51.6 32.4 | 2109 / 2326 2560 / 2654 1022 / 1092 917 / 1034 850 / 910 1579 / 1634 |
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.0depth-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
depth-anything-v2-metric-hypersim-s: Fine-tuned from the relative Depth Anything V2 Small on Hypersim (indoor, synthetic) per the metric_depth READMEdepth-anything-v2-metric-hypersim-b: Fine-tuned from the relative Depth Anything V2 Base on Hypersim (indoor, synthetic) per the metric_depth READMEdepth-anything-v2-metric-hypersim-l: Fine-tuned from the relative Depth Anything V2 Large on Hypersim (indoor, synthetic) per the metric_depth READMEdepth-anything-v2-metric-vkitti-s: Fine-tuned from the relative Depth Anything V2 Small on Virtual KITTI 2 (outdoor driving, synthetic) per the metric_depth READMEdepth-anything-v2-metric-vkitti-b: Fine-tuned from the relative Depth Anything V2 Base on Virtual KITTI 2 (outdoor driving, synthetic) per the metric_depth READMEdepth-anything-v2-metric-vkitti-l: Fine-tuned from the relative Depth Anything V2 Large on Virtual KITTI 2 (outdoor driving, synthetic) per the metric_depth READMEdistill-any-depth-s: Distilled from Depth Anything V2 and GenPercept teachers on 200K unlabeled SA-1B images per the paper (arXiv 2502.19204)distill-any-depth-b: Distilled from Depth Anything V2 and GenPercept teachers on 200K unlabeled SA-1B images per the paper (arXiv 2502.19204)distill-any-depth-l: Distilled from Depth Anything V2 and GenPercept teachers on 200K unlabeled SA-1B images per the paper (arXiv 2502.19204)
- 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).
- Licence note: The six metric checkpoints are Apache-2.0 on their Hugging Face cards, but the Base / Large ones are fine-tuned from the CC-BY-NC-4.0 relative Base / Large weights, and Virtual KITTI 2 (the outdoor fine-tune) is CC BY-NC-SA 3.0, Hypersim CC BY-SA 3.0.
- Licence note: Distill-Any-Depth: Apache-2.0 on the Hugging Face card (the authors' transformers ports say MIT, the code is MIT). The paper initialises the Large model from the CC-BY-NC-4.0 Depth Anything V2 Large weights; its teachers include Depth Anything V2 and it trains on unlabeled SA-1B images (research licence).
- Options:
short_side= 518 (>= 14; alsoinput_size) - Kernel libraries:
fastbb,dpt_fused - Variants:
depth-anything-v2-s,depth-anything-v2-b,depth-anything-v2-l,depth-anything-v2-metric-hypersim-s,depth-anything-v2-metric-hypersim-b,depth-anything-v2-metric-hypersim-l,depth-anything-v2-metric-vkitti-s,depth-anything-v2-metric-vkitti-b,depth-anything-v2-metric-vkitti-l,distill-any-depth-s,distill-any-depth-b,distill-any-depth-l - Outputs: inverse_depth, depth; kind:
affine_invariant_inverse - Input size:
depth-anything-v2-s,depth-anything-v2-b,depth-anything-v2-l: any H x W >= 8, resized or padded inside the model (ViT patch 14)depth-anything-v2-metric-hypersim-s,depth-anything-v2-metric-hypersim-b,depth-anything-v2-metric-hypersim-l,depth-anything-v2-metric-vkitti-s,depth-anything-v2-metric-vkitti-b,depth-anything-v2-metric-vkitti-l,distill-any-depth-s,distill-any-depth-b,distill-any-depth-l: any H x W >= 1, resized or padded inside the model (ViT patch 14)
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
depth-anything-v2-s3000x4000 (0.5 GiB peak allocated, 0.5 reserved);depth-anything-v2-b3000x4000 (0.8 GiB peak allocated, 0.9 reserved);depth-anything-v2-l3000x4000 (1.8 GiB peak allocated, 2.2 reserved);depth-anything-v2-metric-hypersim-s3000x4000 (0.5 GiB peak allocated, 0.5 reserved);depth-anything-v2-metric-hypersim-b3000x4000 (0.6 GiB peak allocated, 0.7 reserved);depth-anything-v2-metric-hypersim-l3000x4000 (1.1 GiB peak allocated, 1.2 reserved);depth-anything-v2-metric-vkitti-s3000x4000 (0.5 GiB peak allocated, 0.5 reserved);depth-anything-v2-metric-vkitti-b3000x4000 (0.6 GiB peak allocated, 0.7 reserved);depth-anything-v2-metric-vkitti-l3000x4000 (1.1 GiB peak allocated, 1.2 reserved);distill-any-depth-s3000x4000 (0.5 GiB peak allocated, 0.5 reserved);distill-any-depth-b3000x4000 (0.6 GiB peak allocated, 0.7 reserved);distill-any-depth-l3000x4000 (1.1 GiB peak allocated, 1.2 reserved) depth-anything-v2-s994x1482, first call: portable + torch.compile 16 s (cold Inductor cache), TensorRT fp16 30 s (ONNX + engine).depth-anything-v2-b994x1482, first call: portable + torch.compile 14 s (cold Inductor cache), TensorRT fp16 33 s (ONNX + engine).depth-anything-v2-l994x1482, first call: portable + torch.compile 21 s (cold Inductor cache), TensorRT fp16 44 s (ONNX + engine).depth-anything-v2-metric-hypersim-s994x1482, first call: portable + torch.compile 16 s (cold Inductor cache), TensorRT fp16 30 s (ONNX + engine).depth-anything-v2-metric-hypersim-b994x1482, first call: portable + torch.compile 16 s (cold Inductor cache), TensorRT fp16 32 s (ONNX + engine).depth-anything-v2-metric-hypersim-l994x1482, first call: portable + torch.compile 20 s (cold Inductor cache), TensorRT fp16 44 s (ONNX + engine).depth-anything-v2-metric-vkitti-s994x1482, first call: portable + torch.compile 16 s (cold Inductor cache), TensorRT fp16 30 s (ONNX + engine).depth-anything-v2-metric-vkitti-b994x1482, first call: portable + torch.compile 16 s (cold Inductor cache), TensorRT fp16 32 s (ONNX + engine).depth-anything-v2-metric-vkitti-l994x1482, first call: portable + torch.compile 20 s (cold Inductor cache), TensorRT fp16 43 s (ONNX + engine).distill-any-depth-s994x1482, first call: portable + torch.compile 16 s (cold Inductor cache), TensorRT fp16 30 s (ONNX + engine).distill-any-depth-b994x1482, first call: portable + torch.compile 16 s (cold Inductor cache), TensorRT fp16 33 s (ONNX + engine).distill-any-depth-l994x1482, first call: portable + torch.compile 20 s (cold Inductor cache), TensorRT fp16 42 s (ONNX + engine).depth-anything-v2-soriginal 994x1482: torch.autocast(fp16) around the forwarddepth-anything-v2-boriginal 994x1482: torch.autocast(fp16) around the forwarddepth-anything-v2-loriginal 994x1482: torch.autocast(fp16) around the forwarddepth-anything-v2-metric-hypersim-soriginal 994x1482: torch.autocast(float16) around the calldepth-anything-v2-metric-hypersim-boriginal 994x1482: torch.autocast(float16) around the calldepth-anything-v2-metric-hypersim-loriginal 994x1482: torch.autocast(float16) around the calldepth-anything-v2-metric-vkitti-soriginal 994x1482: torch.autocast(float16) around the calldepth-anything-v2-metric-vkitti-boriginal 994x1482: torch.autocast(float16) around the calldepth-anything-v2-metric-vkitti-loriginal 994x1482: torch.autocast(float16) around the calldistill-any-depth-soriginal 994x1482: torch.autocast(float16) around the calldistill-any-depth-boriginal 994x1482: torch.autocast(float16) around the calldistill-any-depth-loriginal 994x1482: torch.autocast(float16) around the calldepth-anything-v2-sload / first call: original 0.71 s / 0.38 s, portable 0.11 s / 0.027 s, kernels 0.08† s / 0.009 sdepth-anything-v2-bload / first call: original 3.94 s / 0.08 s, portable 0.85 s / 0.019 s, kernels 0.2† s / 0.012 sdepth-anything-v2-lload / first call: original 5.66 s / 0.149 s, portable 2.39 s / 0.081 s, kernels 0.91† s / 0.055 sdepth-anything-v2-metric-hypersim-sload / first call: original 1.54 s / 0.166 s, portable 0.19 s / 0.227 s (518x770), kernels 0.95 s / 0.055 s (518x770)depth-anything-v2-metric-hypersim-bload / first call: original 2.13 s / 0.074 s, portable 0.33 s / 0.272 s (518x770), kernels 1.13 s / 0.052 s (518x770)depth-anything-v2-metric-hypersim-lload / first call: original 4.87 s / 0.148 s, portable 0.84 s / 0.151 s (518x770), kernels 1.73 s / 0.068 s (518x770)depth-anything-v2-metric-vkitti-sload / first call: original 1.46 s / 0.036 s, portable 0.13 s / 0.157 s (518x770), kernels 0.96 s / 0.053 s (518x770)depth-anything-v2-metric-vkitti-bload / first call: original 2.06 s / 0.06 s, portable 0.3 s / 0.281 s (518x770), kernels 1.13 s / 0.052 s (518x770)depth-anything-v2-metric-vkitti-lload / first call: original 4.87 s / 0.14 s, portable 0.84 s / 0.148 s (518x770), kernels 1.65 s / 0.053 s (518x770)distill-any-depth-sload / first call: original 0.25 s / 0.036 s, portable 0.13 s / 0.159 s (518x770), kernels 0.96 s / 0.039 s (518x770)distill-any-depth-bload / first call: original 0.84 s / 0.06 s, portable 0.29 s / 0.267 s (518x770), kernels 1.13 s / 0.039 s (518x770)distill-any-depth-lload / first call: original 3.03 s / 0.14 s, portable 0.82 s / 0.142 s (518x770), kernels 1.68 s / 0.059 s (518x770)- † 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,
depth-anything-v2-s,depth-anything-v2-b,depth-anything-v2-l: 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 - Protocol,
depth-anything-v2-metric-hypersim-s,depth-anything-v2-metric-hypersim-b,depth-anything-v2-metric-hypersim-l,depth-anything-v2-metric-vkitti-s,depth-anything-v2-metric-vkitti-b,depth-anything-v2-metric-vkitti-l,distill-any-depth-s,distill-any-depth-b,distill-any-depth-l: first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
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.
| variant | dataset | original fp32 | original fp16 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|
depth-anything-v2-s | NYUv2 test, AbsRel / delta1 | 0.0509 / 0.9780 | 0.0509 / 0.9780 | 0.0509 / 0.9780 | 0.0509 / 0.9780 | 0.0509 / 0.9780 | |
depth-anything-v2-s | iBims-1, AbsRel / delta1 | 0.0448 / 0.9744 | 0.0448 / 0.9744 | 0.0448 / 0.9744 | 0.0448 / 0.9744 | 0.0448 / 0.9744 | |
depth-anything-v2-s | ETH3D two-view train left, AbsRel / delta1 | 0.0803 / 0.9256 | 0.0803 / 0.9256 | 0.0803 / 0.9256 | 0.0803 / 0.9256 | possibly in the training data | |
depth-anything-v2-s | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0346 / 0.9947 | 0.0346 / 0.9947 | 0.0346 / 0.9947 | 0.0346 / 0.9947 | possibly in the training data | |
depth-anything-v2-b | NYUv2 test, AbsRel / delta1 | 0.0462 / 0.9806 | 0.0462 / 0.9806 | 0.0462 / 0.9806 | 0.0462 / 0.9806 | 0.0462 / 0.9806 | |
depth-anything-v2-b | iBims-1, AbsRel / delta1 | 0.0378 / 0.9834 | 0.0378 / 0.9834 | 0.0378 / 0.9834 | 0.0378 / 0.9834 | 0.0378 / 0.9834 | |
depth-anything-v2-b | ETH3D two-view train left, AbsRel / delta1 | 0.0696 / 0.9369 | 0.0698 / 0.9361 | 0.0696 / 0.9369 | 0.0696 / 0.9372 | possibly in the training data | |
depth-anything-v2-b | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0318 / 0.9958 | 0.0319 / 0.9957 | 0.0318 / 0.9958 | 0.0318 / 0.9958 | possibly in the training data | |
depth-anything-v2-l | NYUv2 test, AbsRel / delta1 | 0.0439 / 0.9814 | 0.0439 / 0.9814 | 0.0439 / 0.9814 | 0.0439 / 0.9814 | 0.0439 / 0.9814 | |
depth-anything-v2-l | iBims-1, AbsRel / delta1 | 0.0347 / 0.9851 | 0.0347 / 0.9851 | 0.0347 / 0.9851 | 0.0347 / 0.9851 | 0.0347 / 0.9851 | |
depth-anything-v2-l | ETH3D two-view train left, AbsRel / delta1 | 0.0627 / 0.9513 | 0.0627 / 0.9513 | 0.0627 / 0.9512 | 0.0627 / 0.9513 | possibly in the training data | |
depth-anything-v2-l | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0296 / 0.9961 | 0.0296 / 0.9961 | 0.0296 / 0.9961 | 0.0296 / 0.9961 | possibly in the training data | |
depth-anything-v2-metric-hypersim-s | NYUv2 test, AbsRel / delta1 | 0.0643 / 0.9638 | 0.0643 / 0.9639 | 0.0643 / 0.9639 | 0.0643 / 0.9638 | 0.0643 / 0.9639 | |
depth-anything-v2-metric-hypersim-s | iBims-1, AbsRel / delta1 | 0.0559 / 0.9700 | 0.0559 / 0.9701 | 0.0559 / 0.9700 | 0.0559 / 0.9700 | 0.0559 / 0.9700 | |
depth-anything-v2-metric-hypersim-s | ETH3D two-view train left, AbsRel / delta1 | 0.1203 / 0.8637 | 0.1203 / 0.8637 | 0.1204 / 0.8636 | 0.1203 / 0.8637 | possibly in the training data | |
depth-anything-v2-metric-hypersim-s | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0481 / 0.9861 | 0.0481 / 0.9861 | 0.0481 / 0.9861 | 0.0482 / 0.9860 | possibly in the training data | |
depth-anything-v2-metric-hypersim-b | NYUv2 test, AbsRel / delta1 | 0.0549 / 0.9734 | 0.0549 / 0.9734 | 0.0549 / 0.9734 | 0.0549 / 0.9734 | 0.0549 / 0.9734 | |
depth-anything-v2-metric-hypersim-b | iBims-1, AbsRel / delta1 | 0.0476 / 0.9792 | 0.0476 / 0.9792 | 0.0476 / 0.9792 | 0.0476 / 0.9792 | 0.0476 / 0.9792 | |
depth-anything-v2-metric-hypersim-b | ETH3D two-view train left, AbsRel / delta1 | 0.0905 / 0.9235 | 0.0906 / 0.9238 | 0.0905 / 0.9235 | 0.0905 / 0.9235 | possibly in the training data | |
depth-anything-v2-metric-hypersim-b | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0397 / 0.9938 | 0.0397 / 0.9938 | 0.0397 / 0.9938 | 0.0396 / 0.9939 | possibly in the training data | |
depth-anything-v2-metric-hypersim-l | NYUv2 test, AbsRel / delta1 | 0.0491 / 0.9771 | 0.0490 / 0.9771 | 0.0491 / 0.9771 | 0.0491 / 0.9771 | 0.0491 / 0.9771 | |
depth-anything-v2-metric-hypersim-l | iBims-1, AbsRel / delta1 | 0.0382 / 0.9838 | 0.0382 / 0.9838 | 0.0382 / 0.9838 | 0.0382 / 0.9838 | 0.0382 / 0.9838 | |
depth-anything-v2-metric-hypersim-l | ETH3D two-view train left, AbsRel / delta1 | 0.0704 / 0.9586 | 0.0705 / 0.9586 | 0.0704 / 0.9585 | 0.0705 / 0.9586 | possibly in the training data | |
depth-anything-v2-metric-hypersim-l | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0325 / 0.9954 | 0.0325 / 0.9954 | 0.0324 / 0.9954 | 0.0325 / 0.9954 | possibly in the training data | |
depth-anything-v2-metric-vkitti-s | NYUv2 test, AbsRel / delta1 | 0.1225 / 0.8529 | 0.1225 / 0.8530 | 0.1225 / 0.8529 | 0.1225 / 0.8529 | 0.1225 / 0.8530 | |
depth-anything-v2-metric-vkitti-s | iBims-1, AbsRel / delta1 | 0.1145 / 0.8774 | 0.1145 / 0.8775 | 0.1145 / 0.8774 | 0.1145 / 0.8774 | 0.1145 / 0.8773 | |
depth-anything-v2-metric-vkitti-s | ETH3D two-view train left, AbsRel / delta1 | 0.1370 / 0.8210 | 0.1369 / 0.8214 | 0.1370 / 0.8210 | 0.1369 / 0.8210 | possibly in the training data | |
depth-anything-v2-metric-vkitti-s | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0730 / 0.9566 | 0.0729 / 0.9566 | 0.0730 / 0.9566 | 0.0730 / 0.9565 | possibly in the training data | |
depth-anything-v2-metric-vkitti-b | NYUv2 test, AbsRel / delta1 | 0.1089 / 0.8847 | 0.1089 / 0.8847 | 0.1089 / 0.8847 | 0.1089 / 0.8847 | 0.1089 / 0.8847 | |
depth-anything-v2-metric-vkitti-b | iBims-1, AbsRel / delta1 | 0.0998 / 0.9086 | 0.0998 / 0.9085 | 0.0998 / 0.9085 | 0.0998 / 0.9086 | 0.0998 / 0.9085 | |
depth-anything-v2-metric-vkitti-b | ETH3D two-view train left, AbsRel / delta1 | 0.1352 / 0.8311 | 0.1353 / 0.8310 | 0.1353 / 0.8311 | 0.1353 / 0.8311 | possibly in the training data | |
depth-anything-v2-metric-vkitti-b | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0651 / 0.9781 | 0.0651 / 0.9780 | 0.0651 / 0.9780 | 0.0651 / 0.9780 | possibly in the training data | |
depth-anything-v2-metric-vkitti-l | NYUv2 test, AbsRel / delta1 | 0.0968 / 0.9133 | 0.0968 / 0.9133 | 0.0968 / 0.9133 | 0.0968 / 0.9133 | 0.0968 / 0.9133 | |
depth-anything-v2-metric-vkitti-l | iBims-1, AbsRel / delta1 | 0.0783 / 0.9399 | 0.0783 / 0.9399 | 0.0784 / 0.9399 | 0.0783 / 0.9399 | 0.0783 / 0.9399 | |
depth-anything-v2-metric-vkitti-l | ETH3D two-view train left, AbsRel / delta1 | 0.1081 / 0.8993 | 0.1081 / 0.8992 | 0.1081 / 0.8992 | 0.1082 / 0.8991 | possibly in the training data | |
depth-anything-v2-metric-vkitti-l | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0551 / 0.9836 | 0.0551 / 0.9836 | 0.0551 / 0.9837 | 0.0551 / 0.9837 | possibly in the training data | |
distill-any-depth-s | NYUv2 test, AbsRel / delta1 | 0.0529 / 0.9764 | 0.0529 / 0.9764 | 0.0529 / 0.9764 | 0.0529 / 0.9764 | 0.0529 / 0.9764 | |
distill-any-depth-s | iBims-1, AbsRel / delta1 | 0.0476 / 0.9701 | 0.0476 / 0.9701 | 0.0476 / 0.9701 | 0.0476 / 0.9701 | 0.0476 / 0.9701 | |
distill-any-depth-s | ETH3D two-view train left, AbsRel / delta1 | 0.0854 / 0.9094 | 0.0855 / 0.9092 | 0.0855 / 0.9093 | 0.0855 / 0.9093 | possibly in the training data | |
distill-any-depth-s | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0335 / 0.9947 | 0.0335 / 0.9947 | 0.0336 / 0.9947 | 0.0335 / 0.9947 | possibly in the training data | |
distill-any-depth-b | NYUv2 test, AbsRel / delta1 | 0.0470 / 0.9803 | 0.0470 / 0.9803 | 0.0470 / 0.9803 | 0.0470 / 0.9803 | 0.0470 / 0.9803 | |
distill-any-depth-b | iBims-1, AbsRel / delta1 | 0.0392 / 0.9817 | 0.0392 / 0.9816 | 0.0392 / 0.9817 | 0.0392 / 0.9817 | 0.0392 / 0.9817 | |
distill-any-depth-b | ETH3D two-view train left, AbsRel / delta1 | 0.0695 / 0.9386 | 0.0696 / 0.9382 | 0.0695 / 0.9386 | 0.0695 / 0.9386 | possibly in the training data | |
distill-any-depth-b | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0312 / 0.9963 | 0.0312 / 0.9963 | 0.0312 / 0.9963 | 0.0312 / 0.9963 | possibly in the training data | |
distill-any-depth-l | NYUv2 test, AbsRel / delta1 | 0.0444 / 0.9818 | 0.0444 / 0.9817 | 0.0444 / 0.9817 | 0.0444 / 0.9818 | 0.0444 / 0.9817 | |
distill-any-depth-l | iBims-1, AbsRel / delta1 | 0.0375 / 0.9832 | 0.0375 / 0.9832 | 0.0375 / 0.9832 | 0.0375 / 0.9832 | 0.0375 / 0.9832 | |
distill-any-depth-l | ETH3D two-view train left, AbsRel / delta1 | 0.0640 / 0.9537 | 0.0640 / 0.9537 | 0.0640 / 0.9537 | 0.0639 / 0.9537 | possibly in the training data | |
distill-any-depth-l | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0303 / 0.9962 | 0.0303 / 0.9962 | 0.0303 / 0.9962 | 0.0303 / 0.9962 | possibly in the training data |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 468fba10 / 939adfe8 / f2992269+dirty, 2026-11-06 to 2026-11-10; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6d3bab64, 2026-11-17; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 468fba10 / 939adfe8 / f2992269+dirty, 2026-11-06 to 2026-11-10.
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).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
depth-anything-v2-s | 0.00038 / 0.00124 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
depth-anything-v2-b | 0.00072 / 0.00264 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
depth-anything-v2-l | 0.00077 / 0.0024 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
depth-anything-v2-metric-hypersim-s | 0.00075 / 0.00241 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
depth-anything-v2-metric-hypersim-b | 0.00089 / 0.00286 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
depth-anything-v2-metric-hypersim-l | 0.00112 / 0.00349 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
depth-anything-v2-metric-vkitti-s | 0.00093 / 0.00259 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
depth-anything-v2-metric-vkitti-b | 0.00094 / 0.00245 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
depth-anything-v2-metric-vkitti-l | 0.0009 / 0.00242 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
distill-any-depth-s | 0.00046 / 0.00147 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
distill-any-depth-b | 0.001 / 0.00274 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
distill-any-depth-l | 0.00107 / 0.00338 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
Limitations
- Metric checkpoints predict at most max_depth (20 m Hypersim, 80 m Virtual KITTI 2): the head is a sigmoid scaled by it. Each was fine-tuned on one synthetic domain, so indoor / outdoor scenes outside it get a wrong scale.
- Distill-Any-Depth runs with this family's pipeline (short side 518, aspect kept, as the authors' transformers ports); the authors' demo squashes to 700 x 700. Their Dav2-Teacher-Large-2w-iter checkpoint is not included.
Example output
One fixed input through this checkpoint, the same for every model of the task (kernels · float16 · NVIDIA GeForce RTX 5060 Ti).
Input: A cup of coffee, Rachel Michetti (CC0).