Any2Full
Any2Full: metric depth completion that prompts Depth Anything V2 with a sparse depth map of any pattern and density, in small, base and large. Apache-2.0 code and weights.
experimental Fork of zhiyuandaily/Any2Full@780edf6 · backends: portable, kernels
- Paper Any to Full: Prompting Depth Anything for Depth Completion in One Stage ECCV 2026 · first released 5 Mar 2026
Paper 2026 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("any2full-s") # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.depth
result.backend # what ran: mode, device, dtype, kernels fastforks bench any2full-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: synthetic, 994x1482 (the task’s standard size)
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | not measured | – | – | – | – |
| Original (own default)upstream Any2Full.forward (init_scailing, torch.pinverse fit), float32, no xFormers | fp32 | 47.5 | – | 646 MiB/670 MiB | 2.5 | 0.74 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 12.4 | 3.8× | 274 MiB/312 MiB | 0.3 | 0.36 |
| Kernels | fp16 | 9.47 | 5.0× | 218 MiB/252 MiB | 0.4 | 0.30 |
| Portable + torch.compile | 9.88 | 4.8× | 223 MiB/294 MiB | 26 (build) | – | |
| TensorRT fp16 | fp16 | 6.72 | 7.1× | 228 MiBenginenot comparable | 59 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-15 to 2026-11-16. 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-17 | Portable | fp16 | 118 | 1,641 MiB process | skip | 994x1482 |
| Portable | fp32 | 130 | 1,647 MiB process | skip | 994x1482 | |
| Kernels | fp16 | not implemented | – | 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
- Apache-2.0 LICENSE
- Weights
- Apache-2.0 source
- Training data
- Training data and code not released yet (arXiv 2603.05711); the ViT and head start from Depth Anything V2
Our reading of the licences, not legal advice.
Weights
Any2Full_vits.pth.tar 204 MB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download any2full-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.0040 | 1.0000 | reference | 164 | 39.5 |
| Original fp16 | not measured | |||||
| Portable fp32 | fp32 | 0.0038 | 1.0000 | −0.0002 | 164 | 30.3 |
| 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.0081 | 0.9958 | reference | 100 | 38.7 |
| Original fp16 | not measured | |||||
| Portable fp32 | fp32 | 0.0079 | 0.9960 | −0.0002 | 100 | 30.3 |
| 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.005 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 1.5 % and p99 <= 5 % of the reference's median |value| (absolute error of the output depth).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.005 (relative) | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.015 (relative) | 0.00015 (relative) |
| GPU default dtypes, p99 |diff| | ≤ 0.05 (relative) | 0.00057 (relative) |
Recorded for any2full-s on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-14, with these kernels: dpt_fusedfastbb
Details
Any2Full (2026): one-stage depth completion that prompts Depth Anything V2 with a sparse depth map of any pattern and density; the depth tokens modulate the ViT features entering the DPT head, the disparity is fitted to the prompt.
- 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 (516 MiB allocated)
- Options
short_side=518>= 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 map is required: call the model with `prompt_depth=` a metric map in metres (any size, sparse points or holes as 0 / NaN / inf). The output is fitted to it by scale and shift in disparity, so it needs at least two distinct valid values.
- Export has a fixed input size.
Full reference, generated from the repository
Any2Full: metric depth completion that prompts Depth Anything V2 with a sparse depth map of any pattern and density, in small, base and large. Apache-2.0 code and weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
any2full-s | synthetic (994x1482) | original portable kernels portable + torch.compile TensorRT fp16 | 47.5 12.4 9.47 9.88 6.72 | 646 / 670 274 / 312 218 / 252 223 / 294 366 / 398 |
any2full-b | synthetic (994x1482) | original portable kernels portable + torch.compile TensorRT fp16 | 108 26.8 17.2 24.2 15.8 | 1109 / 1160 538 / 596 481 / 536 442 / 496 731 / 794 |
any2full-l | synthetic (994x1482) | original portable kernels portable + torch.compile TensorRT fp16 | 269 67.7 42.3 63.8 40.2 | 2436 / 2788 1178 / 1250 1115 / 1210 987 / 1092 1860 / 1928 |
Details
- Original code: https://github.com/zhiyuandaily/Any2Full at
780edf6 - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: Apache-2.0
- Licence evidence: https://github.com/zhiyuandaily/Any2Full/blob/main/LICENSE and the Hugging Face model card zhiyuandaily/Any2Full (license: apache-2.0)
- Training data: Training data and code not released yet (arXiv 2603.05711); the ViT and head start from Depth Anything V2
- Options:
short_side= 518 (>= 14) - Kernel libraries:
fastbb,dpt_fused - Variants:
any2full-s,any2full-b,any2full-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):
any2full-s3000x4000 (0.5 GiB peak allocated, 0.6 reserved);any2full-b3000x4000 (0.7 GiB peak allocated, 0.9 reserved);any2full-l3000x4000 (1.2 GiB peak allocated, 1.3 reserved) any2full-s994x1482, first call: portable + torch.compile 26 s (cold Inductor cache), TensorRT fp16 59 s (ONNX + engine).any2full-b994x1482, first call: portable + torch.compile 97 s (cold Inductor cache), TensorRT fp16 64 s (ONNX + engine).any2full-l994x1482, first call: portable + torch.compile 34 s (cold Inductor cache), TensorRT fp16 79 s (ONNX + engine).any2full-soriginal 994x1482: upstream Any2Full.forward (init_scailing, torch.pinverse fit), float32, no xFormersany2full-boriginal 994x1482: upstream Any2Full.forward (init_scailing, torch.pinverse fit), float32, no xFormersany2full-loriginal 994x1482: upstream Any2Full.forward (init_scailing, torch.pinverse fit), float32, no xFormersany2full-sload / first call: original 2.55 s / 0.737 s, portable 0.31 s / 0.359 s, kernels 0.37 s / 0.296 sany2full-bload / first call: original 3.73 s / 0.343 s, portable 6.38 s / 3.337 s, kernels 0.74 s / 0.261 sany2full-lload / first call: original 9.41 s / 0.475 s, portable 1.45 s / 0.298 s, kernels 1.5 s / 0.275 s- 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 |
|---|---|---|---|---|---|---|---|
any2full-s | NYUv2 test (every 4th: 164 images) with a 192x256 depth prompt, AbsRel / delta1 (metric) | 0.0040 / 1.0000 | 0.0038 / 1.0000 | ||||
any2full-s | iBims-1 (100 images) with a 192x256 depth prompt, AbsRel / delta1 (metric) | 0.0081 / 0.9958 | 0.0079 / 0.9960 | ||||
any2full-b | NYUv2 test (every 4th: 164 images) with a 192x256 depth prompt, AbsRel / delta1 (metric) | 0.0037 / 1.0000 | 0.0044 / 1.0000 | 0.0034 / 1.0000 | 0.0034 / 1.0000 | 0.0034 / 1.0000 | |
any2full-b | iBims-1 (100 images) with a 192x256 depth prompt, AbsRel / delta1 (metric) | 0.0074 / 0.9962 | 0.0077 / 0.9962 | 0.0071 / 0.9964 | 0.0071 / 0.9964 | 0.0071 / 0.9964 | |
any2full-l | NYUv2 test (every 4th: 164 images) with a 192x256 depth prompt, AbsRel / delta1 (metric) | 0.0037 / 1.0000 | 0.0034 / 1.0000 | ||||
any2full-l | iBims-1 (100 images) with a 192x256 depth prompt, AbsRel / delta1 (metric) | 0.0072 / 0.9963 | 0.0069 / 0.9966 |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 68b2f345, 2026-11-16; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 30c7a8e9, 2026-11-17 to 2026-11-18; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 68b2f345, 2026-11-16.
Parity
CPU, float32: max |diff| <= 0.005 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 1.5 % and p99 <= 5 % of the reference's median |value| (absolute error of the output depth).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
any2full-s | 0.00015 / 0.00057 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
any2full-b | 0.00035 / 0.0014 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
any2full-l | 0.00028 / 0.00098 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
Limitations
- The depth map is required: call the model with
prompt_depth=a metric map in metres (any size, sparse points or holes as 0 / NaN / inf). The output is fitted to it by scale and shift in disparity, so it needs at least two distinct valid values. - Export has a fixed input size.
Example output
No example rendered for this checkpoint yet.