ZipDepth
ZipDepth (Tosi et al., ECCV 2026): a very small, fast network that estimates relative depth (no real-world scale) of a single photo; a convolutional encoder with pooling attention, taught by Depth Anything V2 Large; standard and NPU-friendly versions. MIT code and weights.
experimental Fork of fabiotosi92/ZipDepth@91f3fd2 · backends: portable, kernels
- Paper ZipDepth: Bringing Lightweight Zero-Shot Monocular Depth Anywhere, on Any Device ECCV 2026 · first released 9 Jul 2026
Paper 2026 Added in 0.4.0 Evaluated with 0.4.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("zipdepth-base") # fastest backend that runs here
result = model("photo.jpg")
# result fields: inverse_depth
inverse_depth = result.inverse_depth # a torch tensor
arrays = result.numpy() # the tensor fields as NumPy arrays: arrays["inverse_depth"]
result.backend # what ran: mode, device, dtype
Other ways to run it
- Backend:
depth.load("zipdepth-base", mode="kernels") # or "portable", "auto" (default) - Precision:
depth.load("zipdepth-base", dtype="float32") # full precision: slower, portable only - Options:
depth.load("zipdepth-base", options={"short_side": 384})
fastforks bench zipdepth-base 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 fp32 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32original default fp32 (infer_image: BGR numpy in, cv2 resize on the CPU) | fp32 | 4.44 | – | 120 MiB/164 MiB | 0.5 | 0.49 |
| Original fp16torch.autocast(fp16) around infer_image (the original has no precision option) | fp16 | 7.35 | 0.60× | 136 MiB/174 MiB | 0.1 | 0.55 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 2.99 | 1.5× | 98 MiB/120 MiB | 0.3 | 0.03 |
| Kernels | fp16 | 2.69 | 1.6× | 93 MiB/114 MiB | 0.2 | 0.00 |
| Portable + torch.compile | 1.60 | 2.8× | 112 MiB/130 MiB | 9 (build) | – | |
| TensorRT fp16 | fp16 | 0.725 | 6.1× | 54 MiBenginenot comparable | 24 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-28 to 2026-12-02. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. 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 | Load / first call (s) | Output vs reference | Input |
|---|---|---|---|---|---|---|---|
| Apple silicon runs on macOS | |||||||
| Apple M1 Pro 16 GB (MLX, fp16) MLX, torch 2.14.1, 2026-11-30 | Portable | fp16 | 10.4 | 451 MiB process | 0.9 / 1.5 | skip | 994x1482 |
| Portable | fp32 | 11.5 | 452 MiB process | 0.6 / 2.2 | skip | 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
-
- COCO 2017 (train, instance annotations) CC-BY-4.0
- Objects365 (train, box annotations) CC-BY-4.0, non-commercial
- ADE20K (SceneParsing, 150 classes) noncommercial, non-commercial
- MegaDepth (Internet photo collections with SfM / MVS depth) CC-BY-4.0
- weights licence not stated by the original authors; assumed to be the code licence
- The repository carries one MIT licence for code; the checkpoints are files of the same repository and have no licence statement of their own (assumed MIT). The pseudo-labels the network was distilled from come from Depth Anything V2 Large, whose weights are CC-BY-NC-4.0: the terms for commercial use of the distilled weights are unclear (a note only).
Our reading of the licences, not legal advice.
Weights
zipdepth_base.pth 27.3 MB· hosted on raw.githubusercontent.comfastforks downloads and checks these files on first use (fastforks download zipdepth-base).
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 ↑ | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | not measured | ||||
| Original fp16 | not measured | ||||
| Portable fp32 | fp32 | 0.0766 | 0.9497 | 654 | 3.69 |
| Portable | fp16 | 0.0765 | 0.9498 | 654 | 3.44 |
| Kernels | not measured | ||||
The original code was not run on this dataset, so the table cannot show the distance to it.
Aligned depth scores fit scale and shift by least squares, in disparity space for inverse-depth models. Metric depth scores follow each dataset's protocol. Both average over images. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks f0b2da70d, 2026-11-30.
iBims-1
AbsRel / delta1
| Run | dtype | AbsRel ↓ | δ1 ↑ | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | not measured | ||||
| Original fp16 | not measured | ||||
| Portable fp32 | fp32 | 0.0779 | 0.9339 | 100 | 3.41 |
| Portable | fp16 | 0.0778 | 0.9339 | 100 | 3.60 |
| Kernels | not measured | ||||
The original code was not run on this dataset, so the table cannot show the distance to it.
Aligned depth scores fit scale and shift by least squares, in disparity space for inverse-depth models. Metric depth scores follow each dataset's protocol. Both average over images. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks f0b2da70d, 2026-11-30.
ETH3D two-view train left
AbsRel / delta1training data not stated: possibly seen
| Run | dtype | AbsRel ↓ | δ1 ↑ | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | not measured | ||||
| Original fp16 | not measured | ||||
| Portable fp32 | fp32 | 0.1166 | 0.8523 | 27 | 4.39 |
| Portable | fp16 | 0.1166 | 0.8524 | 27 | 6.21 |
| Kernels | not measured | ||||
The original code was not run on this dataset, so the table cannot show the distance to it.
Aligned depth scores fit scale and shift by least squares, in disparity space for inverse-depth models. Metric depth scores follow each dataset's protocol. Both average over images. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks f0b2da70d, 2026-11-30.
Middlebury 2014 trainingH left
AbsRel / delta1training data not stated: possibly seen
| Run | dtype | AbsRel ↓ | δ1 ↑ | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | not measured | ||||
| Original fp16 | not measured | ||||
| Portable fp32 | fp32 | 0.0532 | 0.9836 | 15 | 5.23 |
| Portable | fp16 | 0.0532 | 0.9837 | 15 | 10.8 |
| Kernels | not measured | ||||
The original code was not run on this dataset, so the table cannot show the distance to it.
Aligned depth scores fit scale and shift by least squares, in disparity space for inverse-depth models. Metric depth scores follow each dataset's protocol. Both average over images. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks f0b2da70d, 2026-11-30.
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 <= 5 % 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.01 (relative) | 0.00484 (relative) |
| GPU default dtypes, p99 |diff| | ≤ 0.05 (relative) | 0.03228 (relative) |
Recorded for zipdepth-base on RTX 5060 Ti, torch 2.14.1+cu130, 2026-12-02, with these kernels: fvm_conv
Details
ZipDepth (Tosi et al., ECCV 2026): lightweight zero-shot relative monocular depth from a RepVGG encoder with strip-pooling and global-context attention and a small FPN decoder with a convex x2 upsampler, distilled from Depth Anything V2 Large; the NPU variant replaces the unfold upsampler by an unfold-free blend.
- 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 >= 1, resized or padded inside the model; tested up to 3000x4000 (426 MiB allocated)
- Options
short_side=384>= 32· changes the output
- Outputs
inverse_depth- Checkpoint
dims=[48,96,192,384],depths=[2,2,6,2],dec_ch=96,half_dec_ch=32,unfold=true- CUDA kernels
fvm_convfused convolutions for image classifiers
Limitations
- Relative depth only: inverse depth up to an unknown scale and shift, not metric.
Full reference, generated from the repository
ZipDepth (Tosi et al., ECCV 2026): a very small, fast network that estimates relative depth (no real-world scale) of a single photo; a convolutional encoder with pooling attention, taught by Depth Anything V2 Large; standard and NPU-friendly versions. MIT code and weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
zipdepth-base | Middlebury 2014 half (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 4.44 7.35 2.99 2.69 1.60 0.725 | 120 / 164 136 / 174 98 / 120 93 / 114 112 / 130 138 / 182 |
zipdepth-base-npu | Middlebury 2014 half (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 4.37 7.32 3.01 2.73 1.63 0.669 | 120 / 148 137 / 178 98 / 120 93 / 114 112 / 130 138 / 182 |
Details
- Original code: https://github.com/fabiotosi92/ZipDepth at
91f3fd2 - Code licence: MIT (permissive); files:
LICENSE - Weights licence: MIT (assumed from code)
- Licence evidence: https://github.com/fabiotosi92/ZipDepth/blob/91f3fd21e131641f51e8d35736d1958350180e3a/LICENSE (the checkpoints are files of the same repository)
- Training data: COCO 2017 (train, instance annotations), Objects365 (train, box annotations), ADE20K (SceneParsing, 150 classes), MegaDepth (Internet photo collections with SfM / MVS depth), not stated by the authors (Distilled from Depth Anything V2 Large pseudo-depth on about 14.1M images of 17 domains (ACDC, ADE20K, BDD100K, Cityscapes, COCO, DrivingStereo, Flickr1024, Gated2Depth, GoogleLandmarks, HRWSI, HoloPix50K, Mapillary, MegaDepth, Objects365, OpenImages v7, SA-1B, Trans10K) per the README)
- Licence note: The repository carries one MIT licence for code; the checkpoints are files of the same repository and have no licence statement of their own (assumed MIT). The pseudo-labels the network was distilled from come from Depth Anything V2 Large, whose weights are CC-BY-NC-4.0: the terms for commercial use of the distilled weights are unclear (a note only).
- Options:
short_side= 384 (>= 32; alsoinput_size) - Kernel libraries:
fvm_conv - Variants:
zipdepth-base,zipdepth-base-npu - Outputs: inverse_depth; kind:
affine_invariant_inverse - Input size: any H x W >= 1, resized or padded inside the model
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
zipdepth-base3000x4000 (0.4 GiB peak allocated, 0.4 reserved);zipdepth-base-npu3000x4000 (0.4 GiB peak allocated, 0.4 reserved) zipdepth-base994x1482, first call: portable + torch.compile 9 s (cold Inductor cache), TensorRT fp16 24 s (ONNX + engine).zipdepth-base-npu994x1482, first call: portable + torch.compile 9 s (cold Inductor cache), TensorRT fp16 16 s (ONNX + engine).zipdepth-baseoriginal (fp32) 994x1482: original default fp32 (infer_image: BGR numpy in, cv2 resize on the CPU)zipdepth-baseoriginal 994x1482: torch.autocast(fp16) around infer_image (the original has no precision option)zipdepth-base-npuoriginal (fp32) 994x1482: original default fp32 (infer_image: BGR numpy in, cv2 resize on the CPU)zipdepth-base-npuoriginal 994x1482: torch.autocast(fp16) around infer_image (the original has no precision option)zipdepth-baseload / first call: original 0.15 s / 0.551 s, portable 0.27 s / 0.029 s, kernels 0.17 s / 0.488 s (518x770)zipdepth-base-npuload / first call: original 0.14 s / 0.009 s, portable 0.06 s / 0.004 s, kernels 0.27 s / 0.328 s (518x770)- Protocol, median of 5 after 3 warm-up, uint8 CUDA input, card defaults; peak = max over the first call and the timed calls
Measured
Aligned depth scores fit scale and shift by least squares, in disparity space for inverse-depth models. Metric depth scores follow each dataset's protocol. Both average over images. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | portable | portable fp32 | note |
|---|---|---|---|---|
zipdepth-base | NYUv2 test, AbsRel / delta1 | 0.0765 / 0.9498 | 0.0766 / 0.9497 | |
zipdepth-base | iBims-1, AbsRel / delta1 | 0.0778 / 0.9339 | 0.0779 / 0.9339 | |
zipdepth-base | ETH3D two-view train left, AbsRel / delta1 | 0.1166 / 0.8524 | 0.1166 / 0.8523 | possibly in the training data |
zipdepth-base | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0532 / 0.9837 | 0.0532 / 0.9836 | possibly in the training data |
zipdepth-base-npu | NYUv2 test, AbsRel / delta1 | 0.0761 / 0.9509 | 0.0761 / 0.9510 | |
zipdepth-base-npu | iBims-1, AbsRel / delta1 | 0.0775 / 0.9337 | 0.0774 / 0.9337 | |
zipdepth-base-npu | ETH3D two-view train left, AbsRel / delta1 | 0.1162 / 0.8547 | 0.1162 / 0.8548 | possibly in the training data |
zipdepth-base-npu | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0532 / 0.9825 | 0.0532 / 0.9825 | possibly in the training data |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks f0b2da70d, 2026-11-30.
Parity
CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 1 % and p99 <= 5 % of the reference's median |value| (absolute error of the output inverse_depth).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
zipdepth-base | 0.00484 / 0.03228 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
zipdepth-base-npu | 0.00325 / 0.01461 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
Limitations
- Relative depth only: inverse depth up to an unknown scale and shift, not metric.
Example output
No example rendered for this checkpoint yet.