Prompt Depth Anything (fastforks)
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.
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/DepthAnything/PromptDA at 9161547.
Author weight repos: https://huggingface.co/depth-anything/prompt-depth-anything-vitl, https://huggingface.co/depth-anything/prompt-depth-anything-vits.
Task: depth. Tier: experimental. Outputs: depth. 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 |
|---|---|---|---|---|
prompt-depth-anything-l@1 |
prompt_depth_anything_vitl.ckpt | 4b3a3e0a60ea |
Apache-2.0 | yes |
prompt-depth-anything-s@1 |
prompt_depth_anything_vits.ckpt | 51b99fef5e3c |
Apache-2.0 | yes |
Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Licence files: LICENSE.
Training data: Synthetic and real RGB-D data (including pseudo-labelled real images) per the paper (arXiv 2412.14015).
Licence evidence: https://github.com/DepthAnything/PromptDA/blob/9161547ca7151e14fcc8f490ad3cc02fa9437483/README.md and the Hugging Face model cards (license: apache-2.0)
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-l 3000x4000 (1.4 GiB peak allocated, 1.7 reserved); prompt-depth-anything-s 3000x4000 (0.6 GiB peak allocated, 0.8 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 |
|---|---|---|---|---|---|---|---|---|---|---|
prompt-depth-anything-l |
756x1008 | β | β | 125 | 69.3 | β | 1.8x | β | 1318 / 1488 | 1179 / 1348 |
prompt-depth-anything-s |
756x1008 | β | β | 18.4 | 11.4 | β | 1.6x | β | 363 / 442 | 297 / 384 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
prompt-depth-anything-l |
4.80 (756x1008) | 1.50 (756x1008) | 2.78 (756x1008) | 0.77 (756x1008) | 0.30 (756x1008) | 0.22 (756x1008) |
prompt-depth-anything-s |
0.42 (756x1008) | 0.37 (756x1008) | 1.20 (756x1008) | 0.79 (756x1008) | 0.24 (756x1008) | 0.18 (756x1008) |
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) |
|---|---|---|---|---|---|---|---|---|---|---|---|
prompt-depth-anything-l |
756x1008 | 125 ms | 117 ms | 75.3 ms | 69.3 ms | 21.2 s | 52.5 s | 1318 / 1488 | 968 / 1148 | 1179 / 1348 | 1649 / 1714 |
prompt-depth-anything-s |
756x1008 | 18.4 ms | 16.3 ms | 10.5 ms | 11.4 ms | 14.7 s | 46.6 s | 363 / 442 | 260 / 322 | 297 / 384 | 368 / 410 |
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
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.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).
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.
Usage
from fastforks import depth
model = depth.load("prompt-depth-anything-l") # 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: prompt-depth-anything-l, prompt-depth-anything-s.
Kernels backend
depth.load("prompt-depth-anything-l", 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.
Model tree for fastforks/prompt-depth-anything
Base model
depth-anything/prompt-depth-anything-vitl