Flor commited on
Commit
e014483
Β·
verified Β·
1 Parent(s): 931e0b9

card: update from fastforks 1cbf1671

Browse files
Files changed (1) hide show
  1. README.md +108 -0
README.md ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: "fastforks"
3
+ pipeline_tag: "depth-estimation"
4
+ license: "apache-2.0"
5
+ tags:
6
+ - "depth"
7
+ - "mono-depth"
8
+ - "monocular-depth"
9
+ - "cuda"
10
+ - "pytorch"
11
+ - "fastforks"
12
+ - "fastforks-card"
13
+ ---
14
+ # Any2Full (fastforks)
15
+
16
+ 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.
17
+
18
+ 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/zhiyuandaily/Any2Full> at `780edf6`.
19
+
20
+ Author weight repos: <https://huggingface.co/zhiyuandaily/Any2Full>.
21
+
22
+ Task: depth. Tier: experimental. Outputs: `depth`. Backends: `portable`, `kernels`.
23
+
24
+ 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).
25
+
26
+ ## Variants
27
+
28
+ Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in [`card.toml`](https://github.com/kleinicke/fastforks/blob/main/src/fastforks/depth/models/any2full/card.toml).
29
+
30
+ | variant | weights (author link) | SHA-256 | weights licence | commercial use |
31
+ |---|---|---|---|---|
32
+ | `any2full-b@1` | [Any2Full_vitb.pth.tar](https://huggingface.co/zhiyuandaily/Any2Full/resolve/5c8271e2e38b55abc2fc2292c9d390ed3b443507/checkpoints/Any2Full_vitb.pth.tar) | `5afd2519e061` | Apache-2.0 | yes |
33
+ | `any2full-l@1` | [Any2Full_vitl.pth.tar](https://huggingface.co/zhiyuandaily/Any2Full/resolve/5c8271e2e38b55abc2fc2292c9d390ed3b443507/checkpoints/Any2Full_vitl.pth.tar) | `ea2809c9c490` | Apache-2.0 | yes |
34
+ | `any2full-s@1` | [Any2Full_vits.pth.tar](https://huggingface.co/zhiyuandaily/Any2Full/resolve/5c8271e2e38b55abc2fc2292c9d390ed3b443507/checkpoints/Any2Full_vits.pth.tar) | `c797e3b93a1b` | Apache-2.0 | yes |
35
+
36
+ ## Licence
37
+
38
+ Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Licence files: `LICENSE`.
39
+
40
+ Training data: Training data and code not released yet (arXiv 2603.05711); the ViT and head start from Depth Anything V2.
41
+
42
+ Licence evidence: https://github.com/zhiyuandaily/Any2Full/blob/main/LICENSE and the Hugging Face model card zhiyuandaily/Any2Full (license: apache-2.0)
43
+
44
+ ## Input size
45
+
46
+ any H x W >= 1, resized or padded inside the model (ViT patch 14)
47
+ Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `any2full-b` 3000x4000 (0.7 GiB peak allocated, 0.9 reserved); `any2full-l` 3000x4000 (1.2 GiB peak allocated, 1.3 reserved); `any2full-s` 3000x4000 (0.5 GiB peak allocated, 0.6 reserved)
48
+
49
+ ## Speed and memory
50
+
51
+ ### Depth, synthetic
52
+
53
+ | model | input | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
54
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
55
+ | `any2full-b` | 994x1482 | – | – | 26.8 | – | – | – | – | 538 / 596 | – |
56
+ | `any2full-l` | 994x1482 | – | – | 67.7 | – | – | – | – | 1178 / 1250 | – |
57
+ | `any2full-s` | 994x1482 | – | – | 12.4 | – | – | – | – | 274 / 312 | – |
58
+
59
+ ### Startup and first call
60
+
61
+ | model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
62
+ | --- | --- | --- | --- | --- | --- | --- |
63
+ | `any2full-b` | – | 6.38 | – | – | 3.34 | – |
64
+ | `any2full-l` | – | 1.45 | – | – | 0.30 | – |
65
+ | `any2full-s` | – | 0.31 | – | – | 0.36 | – |
66
+
67
+ ### torch.compile and TensorRT
68
+
69
+ | 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) |
70
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
71
+ | `any2full-b` | 994x1482 | 26.8 ms | 24.2 ms | deferred (build >5 min) | – | 97.0 s | – | 538 / 596 | 442 / 496 | – | – |
72
+ | `any2full-l` | 994x1482 | 67.7 ms | 63.8 ms | deferred (build >5 min) | – | 33.9 s | – | 1178 / 1250 | 987 / 1092 | – | – |
73
+ | `any2full-s` | 994x1482 | 12.4 ms | deferred (build >5 min) | deferred (build >5 min) | – | – | – | 274 / 312 | – | – | – |
74
+
75
+ Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
76
+
77
+ Hardware, protocol and caveats: [benchmarks](https://github.com/kleinicke/fastforks/blob/main/docs/benchmarks.md) (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.
78
+
79
+ ## Accuracy
80
+
81
+ ### Parity with the original code
82
+
83
+ 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.5 % and p99 <= 5 % of the reference's median |value| (absolute error of the output `depth`).
84
+
85
+ ## Limitations
86
+
87
+ - 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.
88
+ - Export has a fixed input size.
89
+
90
+ ## Usage
91
+
92
+ ```python
93
+ from fastforks import depth
94
+
95
+ model = depth.load("any2full-b") # mode="auto": the preferred backend from recorded measurements
96
+ result = model("room.jpg")
97
+ result.depth # [H, W] float32 tensor; result.kind says what the maps mean
98
+ # models that take a camera: model("room.jpg", intrinsics=K), K [3, 3] in pixels
99
+ result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
100
+ ```
101
+
102
+ Install with `pip install fastforks` (see <https://github.com/kleinicke/fastforks>). Other variants: `any2full-b`, `any2full-l`, `any2full-s`.
103
+
104
+ ## Kernels backend
105
+
106
+ `depth.load("any2full-b", 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.
107
+
108
+ <!-- staged from fastforks 1cbf1671 (2026-11-15) -->