Models · Monocular depth

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

Checkpoint

Paper 2026 Added in 0.2.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 9.47 ms 994x1482, fp16
vs the faster original 5.0× original fp32: 47.5 ms
Peak memory 218 MiB original: 646 MiB
Accuracy vs original fp32 – original not run on the test set

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)

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32fp32not measured ––––
Original (own default)upstream Any2Full.forward (init_scailing, torch.pinverse fit), float32, no xFormersfp32 47.5–646 MiB/670 MiB2.50.74
Portable fp32fp32not measured ––––
Portablefp16 12.43.8×274 MiB/312 MiB0.30.36
Kernelsfp16 9.475.0×218 MiB/252 MiB0.40.30
Portable + torch.compile 9.884.8×223 MiB/294 MiB26 (build)–
TensorRT fp16fp16 6.727.1×228 MiBenginenot comparable59 (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

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-17Portablefp16118 1,641 MiB processskip994x1482
Portablefp32130 1,647 MiB processskip994x1482
Kernelsfp16not 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 Face

fastforks 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)

Rundtypemet_absrel ↑met_d1 ↑Δ met_absrel vs fp32 originalimagesms / image
Original fp32fp320.00401.0000 reference 164 39.5
Original fp16not measured
Portable fp32fp320.00381.0000 −0.0002 164 30.3
Portablenot measured
Kernelsnot 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)

Rundtypemet_absrel ↑met_d1 ↑Δ met_absrel vs fp32 originalimagesms / image
Original fp32fp320.00810.9958 reference 100 38.7
Original fp16not measured
Portable fp32fp320.00790.9960 −0.0002 100 30.3
Portablenot measured
Kernelsnot 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).

CheckToleranceMeasured
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) 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).

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 backbones
  • dpt_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.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
any2full-ssynthetic (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-bsynthetic (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-lsynthetic (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-s 3000x4000 (0.5 GiB peak allocated, 0.6 reserved); any2full-b 3000x4000 (0.7 GiB peak allocated, 0.9 reserved); any2full-l 3000x4000 (1.2 GiB peak allocated, 1.3 reserved)
  • any2full-s 994x1482, first call: portable + torch.compile 26 s (cold Inductor cache), TensorRT fp16 59 s (ONNX + engine).
  • any2full-b 994x1482, first call: portable + torch.compile 97 s (cold Inductor cache), TensorRT fp16 64 s (ONNX + engine).
  • any2full-l 994x1482, first call: portable + torch.compile 34 s (cold Inductor cache), TensorRT fp16 79 s (ONNX + engine).
  • any2full-s original 994x1482: upstream Any2Full.forward (init_scailing, torch.pinverse fit), float32, no xFormers
  • any2full-b original 994x1482: upstream Any2Full.forward (init_scailing, torch.pinverse fit), float32, no xFormers
  • any2full-l original 994x1482: upstream Any2Full.forward (init_scailing, torch.pinverse fit), float32, no xFormers
  • any2full-s load / first call: original 2.55 s / 0.737 s, portable 0.31 s / 0.359 s, kernels 0.37 s / 0.296 s
  • any2full-b load / first call: original 3.73 s / 0.343 s, portable 6.38 s / 3.337 s, kernels 0.74 s / 0.261 s
  • any2full-l load / 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.

variantdatasetoriginal fp32original fp16portableportable fp32kernelsnote
any2full-sNYUv2 test (every 4th: 164 images) with a 192x256 depth prompt, AbsRel / delta1 (metric)0.0040 / 1.00000.0038 / 1.0000
any2full-siBims-1 (100 images) with a 192x256 depth prompt, AbsRel / delta1 (metric)0.0081 / 0.99580.0079 / 0.9960
any2full-bNYUv2 test (every 4th: 164 images) with a 192x256 depth prompt, AbsRel / delta1 (metric)0.0037 / 1.00000.0044 / 1.00000.0034 / 1.00000.0034 / 1.00000.0034 / 1.0000
any2full-biBims-1 (100 images) with a 192x256 depth prompt, AbsRel / delta1 (metric)0.0074 / 0.99620.0077 / 0.99620.0071 / 0.99640.0071 / 0.99640.0071 / 0.9964
any2full-lNYUv2 test (every 4th: 164 images) with a 192x256 depth prompt, AbsRel / delta1 (metric)0.0037 / 1.00000.0034 / 1.0000
any2full-liBims-1 (100 images) with a 192x256 depth prompt, AbsRel / delta1 (metric)0.0072 / 0.99630.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).

variantkernels error vs original, mean / p99GPU, torchkernels used
any2full-s0.00015 / 0.00057RTX 5060 Ti, torch 2.14.1+cu130dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120
any2full-b0.00035 / 0.0014RTX 5060 Ti, torch 2.14.1+cu130dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120
any2full-l0.00028 / 0.00098RTX 5060 Ti, torch 2.14.1+cu130dpt_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.