Depth Pro (fastforks)
Depth Pro (Bochkovskii et al. 2024, Apple): sharp monocular metric depth from three DINOv2 ViT-L/16 encoders (35 overlapping windows of a 3-level image pyramid, the whole image, the field of view) and a multi-resolution conv decoder at 1536x1536; also estimates the focal length.
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/apple/ml-depth-pro at 9e65e4d.
Task: depth. Tier: stable. Outputs: depth, intrinsics. 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-pro@1 |
depth_pro.pt | 3eb35ca68168 |
LicenseRef-research-only | no |
Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: LicenseRef-Apple-Sample-Code. Licence files: LICENSE.
Training data: Mixture of real and synthetic metric-depth datasets per the Depth Pro paper (Table 15); the list is not on the model card.
- Licence note: The Apple sample-code licence and the model licence allow research use only.
Licence evidence: https://github.com/apple/ml-depth-pro/blob/9e65e4d/README.md (License section: code and weights under LICENSE, the Apple sample-code licence) and https://huggingface.co/apple/DepthPro (license: apple-amlr, research use only); the stricter model-card terms are recorded for the weights
Input size
any H x W >= 8, resized or padded inside the model (ViT patch 16)
Tested up to (portable, fp16, RTX 5060 Ti 16 GB): depth-pro 3000x4000 (3.4 GiB peak allocated, 4.0 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-pro |
518x770 | 1769 | 566 | 519 | 271 | 2.1x | 1.9x | 3822 / 4354 | 3289 / 3498 | 3650 / 3778 |
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-pro |
1776 | 569 | 518 | 271 | 2.1x | 1.9x | 3828 / 4294 | 3306 / 3498 | 3667 / 3778 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
depth-pro |
17.34 | 4.67 | 1.11โ | 0.74 | 0.58 | 0.37 |
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-pro |
994x1482 | 518 ms | 488 ms | 299 ms | 271 ms | 39.2 s | 163 s | 3306 / 3498 | 3053 / 3198 | 3667 / 3778 | 4816 / 4882 |
Fixed-size speed and peak memory, all models
| model | mode | 480x640 | 720x1280 | 1080x1920 | 12 MP 3000x4000 |
|---|---|---|---|---|---|
depth-pro |
portable | 558.6 ms / 3317 / 4044 | 558.7 ms / 3323 / 4080 | 559.0 ms / 3337 / 4084 | 562.3 ms / 3451 / 4120 |
depth-pro |
kernels | 272.9 ms / 3621 / 4372 | 272.1 ms / 3628 / 4388 | 271.8 ms / 3641 / 4386 | 274.9 ms / 3754 / 4500 |
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
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-pro |
NYUv2 test, AbsRel / delta1 | 0.0425 / 0.9810 | 0.0425 / 0.9810 | 0.0425 / 0.9810 | 0.0425 / 0.9810 | |
depth-pro |
iBims-1, AbsRel / delta1 | 0.0353 / 0.9827 | 0.0353 / 0.9826 | 0.0353 / 0.9826 | 0.0353 / 0.9827 | |
depth-pro |
ETH3D two-view train left, AbsRel / delta1 | 0.0651 / 0.9642 | 0.0652 / 0.9642 | 0.0652 / 0.9642 | 0.0656 / 0.9638 | possibly in the training data |
depth-pro |
Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0295 / 0.9966 | 0.0295 / 0.9966 | 0.0295 / 0.9966 | 0.0295 / 0.9966 | possibly in the training data |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.
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.005 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).
Usage
from fastforks import depth
# non-commercial weights: run with FASTFORKS_NONCOMMERCIAL=1 in the environment
model = depth.load("depth-pro") # mode="auto": the preferred backend from recorded measurements
result = model("room.jpg")
result.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-pro.
Kernels backend
depth.load("depth-pro", 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.