ZipDepth
ZipDepth is a compact reparameterizable CNN distilled from Depth Anything V2 Large that predicts a dense relative inverse-depth map. LibreYOLO supports it for the depth task: predict and zero-shot validation, with no training path.
- Tasks
- depth
- Sizes
- b, bnpu at 384 px
- Install
pip install libreyolo- Support tier
- Inference only, since v. Predict, validate and export only. Training features do not apply.
- Licenses
- Code MIT, weights MIT. Commercial use
Install
ZipDepth needs no optional extra. Everything it imports is in the base install.
pip install libreyoloPredict
Weights download from Hugging Face on first use and are cached locally.
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreZipDepthb-depth.pt")result = model(SAMPLE_IMAGE, save=True) depth = result.depth_mapprint(depth.min, depth.max, depth.mean)libreyolo predict model=LibreZipDepthb-depth.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=Truefrom libreyolo import LibreYOLO, SAMPLE_IMAGE # Same encoder, an unfold-free upsampling head for compilers that lack# gather/unfold support. Output is visually equivalent to the b checkpoint.model = LibreYOLO("LibreZipDepthbnpu-depth.pt")result = model(SAMPLE_IMAGE, save=True)result.depth_map carries a dense relative inverse-depth map: higher
values mean closer to the camera, and the values have no metric unit or
cross-image scale. save=True writes a colormapped visualization of that map
to disk; Results.plot() does not cover this family, since it is defined for
surface normals and edges only. See prediction for sources,
streaming and result handling.
Variants
Two checkpoints, both the same encoder capacity, differing only in the trained
upsampling head. b uses convex upsampling and runs on GPU or CPU. bnpu
swaps in an unfold-free decoder for NPU and edge compilers that lack
gather/unfold support; its output is documented as visually equivalent to b.
Pick bnpu when the export target is a constrained runtime, b otherwise.
Both checkpoints were distilled from Depth Anything V2 Large pseudo-labels, so this family is the compact, edge-oriented tier of LibreYOLO's depth task, alongside the larger Depth Anything V2 encoders.
Training is not offered for this family. LibreZipDepth.train() raises
NotImplementedError unconditionally: the upstream recipe distills pseudo-labels
over a large image set that is not reproducible as a LibreYOLO training run.
Train upstream at fabiotosi92/ZipDepth
and convert the result with weights/convert_zipdepth_weights.py.
Validate
val() runs the shared depth validator: it aligns each prediction to its
ground truth with a per-image least-squares scale and shift, then reports the
standard zero-shot relative-depth metrics, AbsRel, RMSE and the three delta
thresholds.
from libreyolo import LibreYOLO model = LibreYOLO("LibreZipDepthb-depth.pt")metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/abs_rel"])print(metrics["metrics/rmse"])print(metrics["metrics/delta1"])libreyolo val model=LibreZipDepthb-depth.pt data=my-dataset.yamlExport
| Task | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| depth | depth to ONNX: supported. | depth to TorchScript: supported. | depth to ExecuTorch: supported. | depth to TensorRT: supported. | depth to OpenVINO: supported. | depth to Paddle: not supported | depth to MNN: not supported | depth to RKNN: not supported | depth to ncnn: supported. | depth to TFLite: not supported | depth to CoreML: not supported | depth to Core AI: supported. |
Export follows a fixed-resolution dense contract: the source image is
stretch-resized to the exported canvas, and the returned depth map is resized
back to the original canvas afterward. An exported artifact loads back through
LibreYOLO() on its file suffix, so a .onnx or .ncnn file behaves like a
checkpoint and returns the same Results, with depth_map in place of boxes.
from libreyolo import LibreYOLO model = LibreYOLO("LibreZipDepthb-depth.pt")model.export(format="onnx")model.export(format="ncnn")libreyolo export model=LibreZipDepthb-depth.pt format=onnxlibreyolo export model=LibreZipDepthbnpu-depth.pt format=ncnnfrom libreyolo import LibreYOLO, SAMPLE_IMAGE # The factory routes on the file suffix, so an exported artifact loads# like any checkpoint and returns the same Results object.model = LibreYOLO("LibreZipDepthb-depth.onnx")result = model(SAMPLE_IMAGE) print(result.depth_map.data.shape)Checkpoints
Every published weight file for this family.
| File | Input (px) | Weights license |
|---|---|---|
| depth | ||
| LibreZipDepthb-depth.pt | mit | |
| LibreZipDepthbnpu-depth.pt | mit | |
Every file above exists in the LibreYOLO org today and downloads on first use.
Licensing
Check the license on the Hugging Face repository of the specific weights you download. Every checkpoint in the LibreYOLO org carries one, and they are not always the same across a family. That repository is the authoritative source; the summary below describes what applied when this page was last verified.
This is a description of the licenses involved, not legal advice. If the answer matters commercially, read the licenses yourself and take your own counsel.
- Original work
- ZipDepth, University of Bologna
- Upstream license
- MIT
- Upstream source
- github.com/fabiotosi92/ZipDepth
- LibreYOLO code
- MIT
- Weights
- MIT, republished at huggingface.co/LibreYOLO
- Interpretation
- MIT is a permissive license, so both checkpoints can be used in commercial and closed-source products with no redistribution restriction beyond keeping the license notice. It places no obligation on your own application code. The weights were trained by distilling pseudo-labels from Depth Anything V2 Large, whose Large checkpoint is itself CC-BY-NC-4.0; the ZipDepth authors publish the distilled student under MIT regardless, and LibreYOLO republishes that same MIT-licensed student.
Citation
@inproceedings{tosi2026zipdepth,
title = {ZipDepth: Bringing Lightweight Zero-Shot Monocular Depth Anywhere, on Any Device},
author = {Tosi, Fabio and Bartolomei, Luca and Poggi, Matteo and Mattoccia, Stefano},
booktitle = {European Conference on Computer Vision (ECCV)},
year = {2026}
}Copied from the authors' citation block at github.com/fabiotosi92/ZipDepth#-citation.