Prompt Depth Anything
Prompt Depth Anything: metric depth from one image plus a low-resolution depth prompt (for example a phone LiDAR map), in small and large.
experimental Fork of DepthAnything/PromptDA@9161547 · backends: portable, kernels
- Paper Prompting Depth Anything for 4K Resolution Accurate Metric Depth Estimation CVPR 2025 · first released 18 Dec 2024
Paper 2024 Added in 0.2.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("prompt-depth-anything-s") # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.depth
result.backend # what ran: mode, device, dtype, kernels fastforks bench prompt-depth-anything-s 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.
Input: example image 1920x1440 area-resized + ARKit 192x256 prompt, 756x1008
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 85.7 | 0.90× | 922 MiB/1,284 MiB | 0.4 | 0.77 |
| Original fp16torch.autocast(fp16) around the forward | fp16 | 77.3 | – | 781 MiB/1,112 MiB | 0.4 | 0.79 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 18.4 | 4.2× | 363 MiB/442 MiB | 0.4 | 0.24 |
| Kernels | fp16 | 11.4 | 6.8× | 297 MiB/384 MiB | 1.2 | 0.18 |
| Portable + torch.compile | 16.3 | 4.7× | 260 MiB/322 MiB | 15 (build) | – | |
| TensorRT fp16 | fp16 | 10.5 | 7.3× | 268 MiBenginenot comparable | 47 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-06 to 2026-11-13. 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 | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14 | Original | fp32 | 251 | 2,741 MiB process | – | 756x1008 |
| Portable | fp16 | 195 | 1,588 MiB process | matches | 756x1008 | |
| Portable | fp32 | 216 | 1,611 MiB process | matches | 756x1008 | |
| Kernels | fp16 | not implemented | – | 756x1008 | ||
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
- Apache-2.0 LICENSE
- Weights
- Apache-2.0 source
- Training data
- Synthetic and real RGB-D data (including pseudo-labelled real images) per the paper (arXiv 2412.14015)
Our reading of the licences, not legal advice.
Weights
prompt_depth_anything_vits.ckpt 100 MB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download prompt-depth-anything-s).
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 (every 4th: 164 images) with a 192x256 depth prompt
AbsRel / delta1 (metric)
| Run | dtype | met_absrel ↑ | met_d1 ↑ | Δ met_absrel vs fp32 original | images | ms / image |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 0.0167 | 0.9938 | reference | 164 | 22.2 |
| Original fp16 | not measured | |||||
| Portable fp32 | fp32 | 0.0158 | 0.9943 | −0.0009 | 164 | 19.6 |
| Portable | not measured | |||||
| Kernels | not measured | |||||
AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Prompt depth models: the prompt is a 192x256 low-resolution depth built from the ground truth (mean of the valid pixels per cell, holes filled with the nearest cell), the output is metric depth compared without any scale fit; AbsRel / delta1 over the pixels with ground truth, mean over images. The prompt comes from the ground truth, so the numbers are not comparable with the paper's (ARKitScenes / ScanNet++ with a LiDAR prompt, L1 in mm): they compare our modes with the original. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-17; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 30c7a8e9, 2026-11-17.
iBims-1 (100 images) with a 192x256 depth prompt
AbsRel / delta1 (metric)
| Run | dtype | met_absrel ↑ | met_d1 ↑ | Δ met_absrel vs fp32 original | images | ms / image |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 0.0169 | 0.9934 | reference | 100 | 23.1 |
| Original fp16 | not measured | |||||
| Portable fp32 | fp32 | 0.0163 | 0.9937 | −0.0006 | 100 | 20.1 |
| Portable | not measured | |||||
| Kernels | not measured | |||||
AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Prompt depth models: the prompt is a 192x256 low-resolution depth built from the ground truth (mean of the valid pixels per cell, holes filled with the nearest cell), the output is metric depth compared without any scale fit; AbsRel / delta1 over the pixels with ground truth, mean over images. The prompt comes from the ground truth, so the numbers are not comparable with the paper's (ARKitScenes / ScanNet++ with a LiDAR prompt, L1 in mm): they compare our modes with the original. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-17; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 30c7a8e9, 2026-11-17.
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| <= 0.02 and p99 <= 0.25 (absolute error of the output depth).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.002 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.02 | 0.00092 |
| GPU default dtypes, p99 |diff| | ≤ 0.25 | 0.00342 |
Recorded for prompt-depth-anything-s on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13, with these kernels: dpt_fusedfastbb
Details
Prompt Depth Anything (Lin et al., CVPR 2025): metric depth from an image and a low-resolution metric depth prompt (e.g. a LiDAR map), a DINOv2 ViT with a DPT head that fuses the prompt at every refinement stage.
- 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 (ViT patch 14); tested up to 3000x4000 (570 MiB allocated)
- Options
max_size=1008>= 14· changes the output
- Outputs
depth- Checkpoint
arch="vits"- CUDA kernels
fastbbfast backbone kernels: flash attention, window attention, instance norm and rotary embeddings for ViT and similar backbonesdpt_fusedfused fp16 matrix multiplies and convolutions for DINOv2 backbones and DPT depth heads
- Apple (MPS)
- fp32, fp16
Limitations
- The depth prompt is required: call the model with `prompt_depth=` a finite, positive map in metres (zero or missing LiDAR pixels must be filled first). Export is at a fixed size only.
Full reference, generated from the repository
Prompt Depth Anything: metric depth from one image plus a low-resolution depth prompt (for example a phone LiDAR map), in small and large.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
prompt-depth-anything-s | example image 1920x1440 area-resized + ARKit 192x256 prompt (756x1008) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 85.7 77.3 18.4 11.4 16.3 10.5 | 922 / 1284 781 / 1112 363 / 442 297 / 384 260 / 322 368 / 410 |
prompt-depth-anything-l | example image 1920x1440 area-resized + ARKit 192x256 prompt (756x1008) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 592 438 125 69.3 117 75.3 | 3369 / 4280 3446 / 3810 1318 / 1488 1179 / 1348 968 / 1148 1649 / 1714 |
Details
- Original code: https://github.com/DepthAnything/PromptDA at
9161547 - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: Apache-2.0
- Licence evidence: https://github.com/DepthAnything/PromptDA/blob/9161547ca7151e14fcc8f490ad3cc02fa9437483/README.md and the Hugging Face model cards (license: apache-2.0)
- Training data: Synthetic and real RGB-D data (including pseudo-labelled real images) per the paper (arXiv 2412.14015)
- Options:
max_size= 1008 (>= 14) - Kernel libraries:
fastbb,dpt_fused - Variants:
prompt-depth-anything-s,prompt-depth-anything-l - Outputs: depth; kind:
metric - Input size: any H x W >= 1, resized or padded inside the model (ViT patch 14)
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
prompt-depth-anything-s3000x4000 (0.6 GiB peak allocated, 0.8 reserved);prompt-depth-anything-l3000x4000 (1.4 GiB peak allocated, 1.7 reserved) prompt-depth-anything-s756x1008, first call: portable + torch.compile 15 s (cold Inductor cache), TensorRT fp16 47 s (ONNX + engine).prompt-depth-anything-l756x1008, first call: portable + torch.compile 21 s (cold Inductor cache), TensorRT fp16 52 s (ONNX + engine).prompt-depth-anything-soriginal 756x1008: torch.autocast(fp16) around the forwardprompt-depth-anything-loriginal 756x1008: torch.autocast(fp16) around the forwardprompt-depth-anything-sload / first call: original 0.42 s / 0.792 s (756x1008), portable 0.37 s / 0.244 s (756x1008), kernels 1.2 s / 0.181 s (756x1008)prompt-depth-anything-lload / first call: original 4.8 s / 0.771 s (756x1008), portable 1.5 s / 0.296 s (756x1008), kernels 2.78 s / 0.223 s (756x1008)- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Prompt depth models: the prompt is a 192x256 low-resolution depth built from the ground truth (mean of the valid pixels per cell, holes filled with the nearest cell), the output is metric depth compared without any scale fit; AbsRel / delta1 over the pixels with ground truth, mean over images. The prompt comes from the ground truth, so the numbers are not comparable with the paper's (ARKitScenes / ScanNet++ with a LiDAR prompt, L1 in mm): they compare our modes with the original. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|
prompt-depth-anything-s | NYUv2 test (every 4th: 164 images) with a 192x256 depth prompt, AbsRel / delta1 (metric) | 0.0167 / 0.9938 | 0.0158 / 0.9943 | ||||
prompt-depth-anything-s | iBims-1 (100 images) with a 192x256 depth prompt, AbsRel / delta1 (metric) | 0.0169 / 0.9934 | 0.0163 / 0.9937 | ||||
prompt-depth-anything-l | NYUv2 test (every 4th: 164 images) with a 192x256 depth prompt, AbsRel / delta1 (metric) | 0.0217 / 0.9876 | 0.0217 / 0.9876 | 0.0208 / 0.9883 | 0.0208 / 0.9883 | 0.0208 / 0.9883 | |
prompt-depth-anything-l | iBims-1 (100 images) with a 192x256 depth prompt, AbsRel / delta1 (metric) | 0.0150 / 0.9930 | 0.0151 / 0.9930 | 0.0147 / 0.9932 | 0.0146 / 0.9932 | 0.0147 / 0.9932 |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 33b2432c, 2026-11-16; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 30c7a8e9, 2026-11-17; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 33b2432c, 2026-11-16.
Parity
CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.02 and p99 <= 0.25 (absolute error of the output depth).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
prompt-depth-anything-s | 0.00092 / 0.00342 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
prompt-depth-anything-l | 0.00183 / 0.00937 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
Limitations
- The depth prompt is required: call the model with
prompt_depth=a finite, positive map in metres (zero or missing LiDAR pixels must be filled first). Export is at a fixed size only.
Example output
No example rendered for this checkpoint yet.