ZoeDepth
ZoeDepth from the Intelligent Systems Lab: metric depth from one image, for indoor and outdoor scenes.
stable Fork of isl-org/ZoeDepth@d87f17b · backends: portable, kernels
- Paper ZoeDepth: Zero-shot Transfer by Combining Relative and Metric Depth arXiv · first released 23 Feb 2023
Checkpoint zoedepth-nk
Paper 2023 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("zoedepth-nk") # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.depth
result.backend # what ran: mode, device, dtype, kernels fastforks bench zoedepth-nk 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 | 408 | 0.66× | 3,897 MiB/3,948 MiB | 3.9 | 0.58 |
| Original fp16torch.autocast(fp16) around the forward | fp16 | 271 | – | 2,040 MiB/2,146 MiB | 8.3 | 1.53 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 124 | 2.2× | 2,037 MiB/2,124 MiB | 1.9 | 0.28 |
| Kernels | fp16 | 88.9 | 3.1× | 1,771 MiB/1,960 MiB | 0.3 | 0.12 |
| Portable + torch.compile | 71.7 | 3.8× | 1,813 MiB/1,880 MiB | 94 (build) | – | |
| TensorRT fp16 | fp16 | 73.3 | 3.7× | 852 MiBenginenot comparable | 138 (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-12 | Original | fp32 | 1268 | 4,223 MiB process | matches | 994x1482 |
| Portable | fp16 | 785 | 3,550 MiB process | matches | 994x1482 | |
| Portable | fp32 | 778 | 3,558 MiB process | matches | 994x1482 | |
| Kernels | fp16 | not implemented | – | 994x1482 | ||
| NVIDIA L4 CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 146 | 1,874 MiB/1,964 MiB | – | 994x1482 |
| Kernels | fp16 | 116 | 1,685 MiB/1,860 MiB | – | 994x1482 | |
| NVIDIA L40S CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 45.7 | 1,874 MiB/1,964 MiB | – | 994x1482 |
| Kernels | fp16 | 32.1 | 1,685 MiB/1,860 MiB | – | 994x1482 | |
| NVIDIA A10 CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 128 | 1,876 MiB/1,964 MiB | – | 994x1482 |
| Kernels | fp16 | 92.9 | 1,682 MiB/1,862 MiB | – | 994x1482 | |
| NVIDIA A100-SXM4-40GB CUDA, torch 2.14.1+cu130, 2026-11-08 | Portable | fp16 | 61.3 | 1,874 MiB/1,964 MiB | – | 994x1482 |
| Kernels | fp16 | 41.2 | 1,686 MiB/1,880 MiB | – | 994x1482 | |
| NVIDIA RTX PRO 6000 CUDA, torch 2.14.1+cu130, 2026-11-08 | Portable | fp16 | 29.5 | 1,983 MiB/2,064 MiB | – | 994x1482 |
| Kernels | fp16 | 19.2 | 1,711 MiB/1,900 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
- MIT LICENSE
- Weights
- MIT (assumed from code)(not stated by the authors; assumed to follow the code) source
- Training data
-
- NYU Depth V2 not stated
- KITTI stereo / optical flow 2012 / 2015 CC-BY-NC-SA-3.0, non-commercial
- MegaDepth (Internet photo collections with SfM / MVS depth) CC-BY-4.0
- TartanAir CC-BY-4.0
- weights licence not stated by the original authors; assumed to be the code licence
Our reading of the licences, not legal advice.
Weights
ZoeD_M12_NK.pt 1.4 GB· hosted on GitHubfastforks downloads and checks these files on first use (fastforks download zoedepth-nk).
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.0532 | 0.9737 | reference | 654 | 272 |
| Original fp16 | fp16 | 0.0528 | 0.9743 | – | 654NaN / inf output | 199 |
| Portable fp32 | fp32 | 0.0532 | 0.9737 | ±0.0000 | 654 | 192 |
| Portable | fp16 | 0.0532 | 0.9737 | ±0.0000 | 654 | 108 |
| Kernels | fp16 | 0.0532 | 0.9737 | ±0.0000 | 654 | 75.0 |
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.0669 | 0.9545 | reference | 100 | 273 |
| Original fp16 | fp16 | 0.0668 | 0.9546 | – | 100NaN / inf output | 199 |
| Portable fp32 | fp32 | 0.0669 | 0.9545 | ±0.0000 | 100 | 192 |
| Portable | fp16 | 0.0669 | 0.9545 | ±0.0000 | 100 | 108 |
| Kernels | fp16 | 0.0669 | 0.9545 | ±0.0000 | 100 | 74.9 |
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.1139 | 0.8648 | reference | 27 | 490 |
| Original fp16 | fp16 | 0.1130 | 0.8653 | – | 27NaN / inf output | 308 |
| Portable fp32 | not measured | |||||
| Portable | fp16 | 0.1139 | 0.8647 | ±0.0000 | 27 | 147 |
| Kernels | fp16 | 0.1139 | 0.8648 | ±0.0000 | 27 | 105 |
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.0449 | 0.9860 | reference | 15 | 333 |
| Original fp16 | fp16 | 0.0449 | 0.9860 | ±0.0000 | 15 | 251 |
| Portable fp32 | not measured | |||||
| Portable | fp16 | 0.0449 | 0.9860 | ±0.0000 | 15 | 129 |
| Kernels | fp16 | 0.0449 | 0.9860 | ±0.0000 | 15 | 90.1 |
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| <= 1 % and p99 <= 3 % of the reference's median |value| (absolute error of the output depth).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.002 (relative) | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.01 (relative) | 0.00045 (relative) |
| GPU default dtypes, p99 |diff| | ≤ 0.03 (relative) | 0.00078 (relative) |
Recorded for zoedepth-nk on RTX 5060 Ti, torch 2.14.1+cu130, 2026-10-29, with these kernels: cudnn_hacc
Details
ZoeDepth (Bhat et al. 2023): metric monocular depth from a MiDaS v3.1 BEiT-L/16 core with metric-bins heads (NYU indoor, KITTI outdoor) chosen by a learned domain router (ZoeD_M12_NK).
- 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; tested up to 3000x4000 (2,451 MiB allocated)
- Options
pad_input=true· changes the outputflip=true· changes the output
- Outputs
depth- CUDA kernels
cudnn_haccconvolutions with fp16 accumulation (cuDNN)
- Apple (MPS)
- fp32, fp16
Limitations
- torch.compile(fullgraph=True) and torch.export are not supported: graph break in the vendored MiDaS core call and data-dependent NYU / KITTI head routing (documented xfail).
- Inputs below 5 px per side raise InputError when pad_input is on.
Full reference, generated from the repository
ZoeDepth from the Intelligent Systems Lab: metric depth from one image, for indoor and outdoor scenes.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
zoedepth-nk | Middlebury 2014 half (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 408 271 124 88.9 71.7 73.3 | 3897 / 3948 2040 / 2146 2037 / 2124 1771 / 1960 1813 / 1880 2246 / 2306 |
Details
- Original code: https://github.com/isl-org/ZoeDepth at
d87f17b - Code licence: MIT (permissive); files:
LICENSE - Weights licence: MIT (assumed from code)
- Licence evidence: https://github.com/isl-org/ZoeDepth/blob/d87f17b2f5fdcb174cf4fb115491f4a6c60de152/LICENSE (weights are release assets of the same repository)
- Training data: NYU Depth V2, KITTI stereo / optical flow 2012 / 2015, MegaDepth (Internet photo collections with SfM / MVS depth), TartanAir, not stated by the authors (MiDaS v3.1 BEiT-L relative-depth pre-training on 12 datasets, then metric fine-tuning on NYU Depth V2 and KITTI (ZoeDepth paper, arXiv 2302.12288))
- Options:
pad_input= True,flip= True - Kernel libraries:
cudnn_hacc - Variants:
zoedepth-nk - Outputs: depth; kind:
metric - Input size: any H x W >= 8, resized or padded inside the model
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
zoedepth-nk3000x4000 (2.4 GiB peak allocated, 2.6 reserved) zoedepth-nk994x1482, first call: portable + torch.compile 94 s (cold Inductor cache), TensorRT fp16 138 s (ONNX + engine).zoedepth-nkoriginal 994x1482: torch.autocast(fp16) around the forwardzoedepth-nkload / first call: original 8.35 s / 1.528 s, portable 1.92 s / 0.275 s, kernels 0.33† s / 0.122 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.
| variant | dataset | original fp32 | original fp16 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|
zoedepth-nk | NYUv2 test, AbsRel / delta1 | 0.0532 / 0.9737 | 0.0528 / 0.9743 (NaN / inf output) | 0.0532 / 0.9737 | 0.0532 / 0.9737 | 0.0532 / 0.9737 | |
zoedepth-nk | iBims-1, AbsRel / delta1 | 0.0669 / 0.9545 | 0.0668 / 0.9546 (NaN / inf output) | 0.0669 / 0.9545 | 0.0669 / 0.9545 | 0.0669 / 0.9545 | |
zoedepth-nk | ETH3D two-view train left, AbsRel / delta1 | 0.1139 / 0.8648 | 0.1130 / 0.8653 (NaN / inf output) | 0.1139 / 0.8647 | 0.1139 / 0.8648 | possibly in the training data | |
zoedepth-nk | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0449 / 0.9860 | 0.0449 / 0.9860 | 0.0449 / 0.9860 | 0.0449 / 0.9860 | possibly in the training data |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06; 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 939adfe8, 2026-11-06.
Parity
CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 1 % and p99 <= 3 % of the reference's median |value| (absolute error of the output depth).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
zoedepth-nk | 0.00045 / 0.00078 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400 |
Limitations
- torch.compile(fullgraph=True) and torch.export are not supported: graph break in the vendored MiDaS core call and data-dependent NYU / KITTI head routing (documented xfail).
- Inputs below 5 px per side raise InputError when pad_input is on.
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).