Depth Anything V2 (fastforks)
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.
This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: https://github.com/kleinicke/fastforks. Kernels for the kernels backend: https://huggingface.co/fastforks/kernels. Original code: https://github.com/DepthAnything/Depth-Anything-V2 at a561b84.
Author weight repos: https://huggingface.co/depth-anything/Depth-Anything-V2-Base, https://huggingface.co/depth-anything/Depth-Anything-V2-Large, https://huggingface.co/depth-anything/Depth-Anything-V2-Metric-Hypersim-Base, https://huggingface.co/depth-anything/Depth-Anything-V2-Metric-Hypersim-Large, https://huggingface.co/depth-anything/Depth-Anything-V2-Metric-Hypersim-Small, https://huggingface.co/depth-anything/Depth-Anything-V2-Metric-VKITTI-Base, https://huggingface.co/depth-anything/Depth-Anything-V2-Metric-VKITTI-Large, https://huggingface.co/depth-anything/Depth-Anything-V2-Metric-VKITTI-Small, https://huggingface.co/depth-anything/Depth-Anything-V2-Small, https://huggingface.co/xingyang1/Distill-Any-Depth.
Task: depth. Tier: stable. Outputs: inverse_depth, depth. Backends: portable, kernels.
Input: one RGB image. Output: a depth or inverse-depth map. kind (a card field, result.kind) says what the numbers mean: metric = metres; scale_invariant, affine_invariant, affine_invariant_log (log depth) and affine_invariant_inverse are relative (unknown scale or shift, not metres). Metric models that use the focal length take model(image, intrinsics=K) (K [3, 3], pixels of the input): metric3d-vit-large and da3metric-large need it for correct metres (da3metric-large: metres = output x focal / 300; without intrinsics= a 300 px focal length is assumed, wrong for a real camera). unidepth-v2-vitl14, unik3d-vitl, depth-pro and MoGe estimate the camera themselves (given intrinsics= replace fx); zoedepth-nk and the relative models (da3mono-large too) take none. Normals-only models (kind none) return result.normals [B, H, W, 3] (unit vectors, camera frame: x right, y down, z forward).
Variants
Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in card.toml.
| variant | weights (author link) | SHA-256 | weights licence | commercial use |
|---|---|---|---|---|
depth-anything-v2-b@1 |
depth_anything_v2_vitb.pth | 0d2b7002e62d |
CC-BY-NC-4.0 | no |
depth-anything-v2-l@1 |
depth_anything_v2_vitl.pth | a7ea19fa0ed9 |
CC-BY-NC-4.0 | no |
depth-anything-v2-metric-hypersim-b@1 |
depth_anything_v2_metric_hypersim_vitb.pth | 9dc9e274c5ef |
Apache-2.0 | yes |
depth-anything-v2-metric-hypersim-l@1 |
depth_anything_v2_metric_hypersim_vitl.pth | 6f82ff2bc543 |
Apache-2.0 | yes |
depth-anything-v2-metric-hypersim-s@1 |
depth_anything_v2_metric_hypersim_vits.pth | b782898d8a3e |
Apache-2.0 | yes |
depth-anything-v2-metric-vkitti-b@1 |
depth_anything_v2_metric_vkitti_vitb.pth | 4dad67a7cc10 |
Apache-2.0 | yes |
depth-anything-v2-metric-vkitti-l@1 |
depth_anything_v2_metric_vkitti_vitl.pth | 239b1054a369 |
Apache-2.0 | yes |
depth-anything-v2-metric-vkitti-s@1 |
depth_anything_v2_metric_vkitti_vits.pth | 9203e538d352 |
Apache-2.0 | yes |
depth-anything-v2-s@1 |
depth_anything_v2_vits.pth | 715fade13be8 |
Apache-2.0 | yes |
distill-any-depth-b@1 |
Distill-Any-Depth/base/model.safetensors | ee99258af6c4 |
Apache-2.0 | yes |
distill-any-depth-l@1 |
Distill-Any-Depth/large/model.safetensors | c7d46f6f0048 |
Apache-2.0 | yes |
distill-any-depth-s@1 |
Distill-Any-Depth/small/model.safetensors | 56a173c0e1b5 |
Apache-2.0 | yes |
Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Licence files: LICENSE.
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).
- 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).
Licence evidence: https://github.com/DepthAnything/Depth-Anything-V2/blob/main/README.md (LICENSE section) and the Hugging Face model cards
Input size
depth-anything-v2-b,depth-anything-v2-l,depth-anything-v2-s: any H x W >= 8, resized or padded inside the model (ViT patch 14)depth-anything-v2-metric-hypersim-b,depth-anything-v2-metric-hypersim-l,depth-anything-v2-metric-hypersim-s,depth-anything-v2-metric-vkitti-b,depth-anything-v2-metric-vkitti-l,depth-anything-v2-metric-vkitti-s,distill-any-depth-b,distill-any-depth-l,distill-any-depth-s: 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-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-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-hypersim-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);depth-anything-v2-metric-vkitti-s3000x4000 (0.5 GiB peak allocated, 0.5 reserved);depth-anything-v2-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);distill-any-depth-s3000x4000 (0.5 GiB peak allocated, 0.5 reserved)
Speed and memory
Depth, synthetic
| model | input | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|---|
depth-anything-v2-b |
518x770 | 88.8 | 53.8 | 18.8 | 10.6 | 5.1x | 1.8x | 928 / 1026 | 433 / 516 | 370 / 436 |
depth-anything-v2-l |
518x770 | 240 | 136 | 55.0 | 31.6 | 4.3x | 1.7x | 2560 / 2654 | 1009 / 1352 | 904 / 1034 |
depth-anything-v2-metric-hypersim-b |
994x1482 | โ | โ | 18.6 | 10.8 | โ | 1.7x | โ | 445 / 514 | 349 / 396 |
depth-anything-v2-metric-hypersim-l |
994x1482 | โ | โ | 54.5 | 31.7 | โ | 1.7x | โ | 1022 / 1092 | 917 / 1034 |
depth-anything-v2-metric-hypersim-s |
994x1482 | โ | โ | 7.66 | 4.67 | โ | 1.6x | โ | 244 / 288 | 152 / 208 |
depth-anything-v2-metric-vkitti-l |
994x1482 | โ | โ | 54.5 | 31.9 | โ | 1.7x | โ | 1022 / 1092 | 917 / 1034 |
depth-anything-v2-s |
518x770 | 45.5 | 38.1 | 7.73 | 4.45 | 8.6x | 1.7x | 373 / 418 | 232 / 326 | 173 / 248 |
distill-any-depth-l |
994x1482 | โ | โ | 54.4 | 31.8 | โ | 1.7x | โ | 1022 / 1092 | 917 / 1034 |
distill-any-depth-s |
994x1482 | โ | โ | 7.65 | 4.63 | โ | 1.7x | โ | 244 / 288 | 152 / 208 |
Depth, Middlebury 2014 half, 994x1482
| model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|
depth-anything-v2-b |
93.6 | 63.2 | 18.8 | 10.5 | 6.0x | 1.8x | 928 / 1026 | 450 / 516 | 387 / 436 |
depth-anything-v2-l |
245 | 140 | 55.1 | 31.1 | 4.5x | 1.8x | 2560 / 2654 | 1026 / 1352 | 921 / 1034 |
depth-anything-v2-metric-hypersim-b |
91.4 | 60.7 | โ | โ | โ | โ | 928 / 1026 | โ | โ |
depth-anything-v2-metric-hypersim-l |
246 | 141 | โ | โ | โ | โ | 2560 / 2654 | โ | โ |
depth-anything-v2-metric-hypersim-s |
53.0 | 43.6 | โ | โ | โ | โ | 373 / 418 | โ | โ |
depth-anything-v2-metric-vkitti-b |
90.8 | 60.6 | โ | โ | โ | โ | 928 / 1026 | โ | โ |
depth-anything-v2-metric-vkitti-l |
245 | 141 | โ | โ | โ | โ | 2560 / 2654 | โ | โ |
depth-anything-v2-metric-vkitti-s |
46.1 | 36.0 | โ | โ | โ | โ | 373 / 418 | โ | โ |
depth-anything-v2-s |
53.6 | 41.0 | 7.82 | 4.51 | 9.1x | 1.7x | 373 / 418 | 249 / 326 | 190 / 248 |
distill-any-depth-b |
90.5 | 59.8 | โ | โ | โ | โ | 928 / 1026 | โ | โ |
distill-any-depth-l |
244 | 139 | โ | โ | โ | โ | 2560 / 2654 | โ | โ |
distill-any-depth-s |
45.3 | 35.2 | โ | โ | โ | โ | 373 / 418 | โ | โ |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
depth-anything-v2-b |
3.94 | 0.85 | 0.20โ | 0.08 | 0.02 | 0.01 |
depth-anything-v2-l |
5.66 | 2.39 | 0.91โ | 0.15 | 0.08 | 0.06 |
depth-anything-v2-metric-hypersim-b |
2.13 | 0.33 (518x770) | 1.13 (518x770) | 0.07 | 0.27 (518x770) | 0.05 (518x770) |
depth-anything-v2-metric-hypersim-l |
4.87 | 0.84 (518x770) | 1.73 (518x770) | 0.15 | 0.15 (518x770) | 0.07 (518x770) |
depth-anything-v2-metric-hypersim-s |
1.54 | 0.19 (518x770) | 0.95 (518x770) | 0.17 | 0.23 (518x770) | 0.06 (518x770) |
depth-anything-v2-metric-vkitti-b |
2.06 | 0.30 (518x770) | 1.13 (518x770) | 0.06 | 0.28 (518x770) | 0.05 (518x770) |
depth-anything-v2-metric-vkitti-l |
4.87 | 0.84 (518x770) | 1.65 (518x770) | 0.14 | 0.15 (518x770) | 0.05 (518x770) |
depth-anything-v2-metric-vkitti-s |
1.46 | 0.13 (518x770) | 0.96 (518x770) | 0.04 | 0.16 (518x770) | 0.05 (518x770) |
depth-anything-v2-s |
0.71 | 0.11 | 0.08โ | 0.38 | 0.03 | 0.01 |
distill-any-depth-b |
0.84 | 0.29 (518x770) | 1.13 (518x770) | 0.06 | 0.27 (518x770) | 0.04 (518x770) |
distill-any-depth-l |
3.03 | 0.82 (518x770) | 1.68 (518x770) | 0.14 | 0.14 (518x770) | 0.06 (518x770) |
distill-any-depth-s |
0.25 | 0.13 (518x770) | 0.96 (518x770) | 0.04 | 0.16 (518x770) | 0.04 (518x770) |
torch.compile and TensorRT
| model | input | time: portable | compile | TensorRT fp16 | kernels | preparation: compile (cold first call) | ONNX + engine build | peak MiB (alloc / reserved): portable | compile | kernels | TensorRT (engine + torch) |
|---|---|---|---|---|---|---|---|---|---|---|---|
depth-anything-v2-b |
994x1482 | 18.8 ms | 17.0 ms | 10.9 ms | 10.5 ms | 14.2 s | 32.7 s | 450 / 516 | 340 / 394 | 387 / 436 | 539 / 596 |
depth-anything-v2-l |
994x1482 | 55.1 ms | 51.7 ms | 32.4 ms | 31.1 ms | 20.6 s | 43.5 s | 1026 / 1352 | 850 / 952 | 921 / 1034 | 1579 / 1634 |
depth-anything-v2-metric-hypersim-b |
994x1482 | 18.6 ms | 17.0 ms | 10.8 ms | 10.8 ms | 16.0 s | 32.0 s | 445 / 514 | 340 / 394 | 349 / 396 | 539 / 614 |
depth-anything-v2-metric-hypersim-l |
994x1482 | 54.5 ms | 51.3 ms | 32.3 ms | 31.7 ms | 20.2 s | 43.5 s | 1022 / 1092 | 850 / 910 | 917 / 1034 | 1579 / 1634 |
depth-anything-v2-metric-hypersim-s |
994x1482 | 7.66 ms | 6.67 ms | 4.47 ms | 4.67 ms | 15.8 s | 29.8 s | 244 / 288 | 201 / 224 | 152 / 208 | 305 / 348 |
depth-anything-v2-metric-vkitti-b |
994x1482 | 18.6 ms | 17.0 ms | 10.9 ms | 10.8 ms | 15.9 s | 32.0 s | 445 / 514 | 340 / 394 | 349 / 396 | 539 / 614 |
depth-anything-v2-metric-vkitti-l |
994x1482 | 54.5 ms | 51.3 ms | 32.4 ms | 31.9 ms | 20.1 s | 43.4 s | 1022 / 1092 | 850 / 910 | 917 / 1034 | 1579 / 1634 |
depth-anything-v2-metric-vkitti-s |
994x1482 | 7.66 ms | 6.68 ms | 4.47 ms | 4.67 ms | 15.8 s | 29.9 s | 244 / 288 | 201 / 224 | 152 / 208 | 305 / 348 |
depth-anything-v2-s |
994x1482 | 7.82 ms | 6.65 ms | 4.46 ms | 4.51 ms | 15.7 s | 29.9 s | 249 / 326 | 201 / 224 | 190 / 248 | 273 / 308 |
distill-any-depth-b |
994x1482 | 18.6 ms | 17.0 ms | 10.8 ms | 10.8 ms | 16.2 s | 33.0 s | 445 / 514 | 340 / 394 | 349 / 396 | 539 / 614 |
distill-any-depth-l |
994x1482 | 54.4 ms | 51.6 ms | 32.4 ms | 31.8 ms | 20.1 s | 42.5 s | 1022 / 1092 | 850 / 910 | 917 / 1034 | 1579 / 1634 |
distill-any-depth-s |
994x1482 | 7.65 ms | 6.67 ms | 4.46 ms | 4.63 ms | 15.9 s | 29.9 s | 244 / 288 | 201 / 224 | 152 / 208 | 305 / 348 |
Fixed-size speed and peak memory, all models
| model | mode | 480x640 | 720x1280 | 1080x1920 | 12 MP 3000x4000 |
|---|---|---|---|---|---|
depth-anything-v2-b |
portable | 18.8 ms / 643 / 776 | 26.2 ms / 733 / 876 | 26.3 ms / 745 / 908 | 20.0 ms / 787 / 924 |
depth-anything-v2-b |
kernels | 9.5 ms / 325 / 408 | 13.6 ms / 376 / 466 | 13.7 ms / 390 / 486 | 10.7 ms / 606 / 622 |
depth-anything-v2-l |
portable | 55.9 ms / 1752 / 1946 | 78.6 ms / 1915 / 2170 | 78.8 ms / 1928 / 2180 | 57.1 ms / 1885 / 2216 |
depth-anything-v2-l |
kernels | 28.3 ms / 875 / 1000 | 38.7 ms / 965 / 1104 | 38.8 ms / 977 / 1112 | 29.3 ms / 1058 / 1174 |
depth-anything-v2-s |
portable | 8.1 ms / 262 / 326 | 10.9 ms / 314 / 376 | 11.0 ms / 329 / 422 | 9.5 ms / 509 / 536 |
depth-anything-v2-s |
kernels | 4.0 ms / 129 / 166 | 5.7 ms / 164 / 218 | 5.8 ms / 177 / 214 | 5.1 ms / 462 / 480 |
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
depth-anything-v2-metric-vkitti-b,distill-any-depth-b: same network and settings asdepth-anything-v2-metric-hypersim-b, measured once (rows not repeated).depth-anything-v2-metric-vkitti-s: same network and settings asdepth-anything-v2-metric-hypersim-s, measured once (rows not repeated).
Resizes to its working resolution: time depends on the aspect ratio, not the input pixels.
Hardware, protocol and caveats: benchmarks (RTX 5060 Ti 16 GB, sm_120). Original = the original code named above at the precision of portable (fp16, or (fp32) where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's.
Accuracy
On public datasets
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 | 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 | |
depth-anything-v2-s |
iBims-1, AbsRel / delta1 | 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 | |
depth-anything-v2-b |
iBims-1, AbsRel / delta1 | 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 | |
depth-anything-v2-l |
iBims-1, AbsRel / delta1 | 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.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 | |
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 | |
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 | |
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 | |
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 | |
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.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.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 | |
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.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 | |
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 | |
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 | |
distill-any-depth-s |
iBims-1, AbsRel / delta1 | 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 | |
distill-any-depth-b |
iBims-1, AbsRel / delta1 | 0.0392 / 0.9817 | 0.0392 / 0.9816 | 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.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 | |
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 NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 468fba10 / 939adfe8 / f2992269+dirty, 2026-11-06 to 2026-11-10.
Parity with the original code
Every variant is checked against reference outputs of the original code at its pinned commit. 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).
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.
Usage
from fastforks import depth
# non-commercial weights: run with FASTFORKS_NONCOMMERCIAL=1 in the environment
model = depth.load("depth-anything-v2-b") # mode="auto": the preferred backend from recorded measurements
result = model("room.jpg")
result.inverse_depth # [H, W] float32 tensor; result.kind says what the maps mean
# models that take a camera: model("room.jpg", intrinsics=K), K [3, 3] in pixels
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
Install with pip install fastforks (see https://github.com/kleinicke/fastforks). Other variants: depth-anything-v2-b, depth-anything-v2-l, depth-anything-v2-metric-hypersim-b, depth-anything-v2-metric-hypersim-l, depth-anything-v2-metric-hypersim-s, depth-anything-v2-metric-vkitti-b, depth-anything-v2-metric-vkitti-l, depth-anything-v2-metric-vkitti-s, depth-anything-v2-s, distill-any-depth-b, distill-any-depth-l, distill-any-depth-s.
Kernels backend
depth.load("depth-anything-v2-b", mode="kernels") runs our CUDA kernels (fastbb, dpt_fused). It needs a prebuilt kernel for your GPU architecture (downloaded from https://huggingface.co/fastforks/kernels on first use) and a recent NVIDIA driver; if there is none it raises BackendUnavailableError with the reason and never falls back silently. mode="auto" picks kernels when it can run and logs the choice.
Model tree for fastforks/depth-anything-v2
Base model
depth-anything/Depth-Anything-V2-Base