Flor commited on
Commit
3adab4d
Β·
verified Β·
1 Parent(s): c840860

card: update from fastforks 1cbf1671

Browse files
Files changed (1) hide show
  1. README.md +106 -0
README.md ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ base_model:
14
+ - "robbyant/lingbot-depth-postrain-dc-vitl14"
15
+ - "robbyant/lingbot-depth-pretrain-vitl-14-v0.5"
16
+ ---
17
+ # LingBot-Depth (fastforks)
18
+
19
+ LingBot-Depth (Robbyant, 2026): metric depth completion from an image and an incomplete or noisy metric depth map (RGB-D); a DINOv2 ViT-L that attends over image and depth tokens, with MoGe's conv neck and depth / mask heads.
20
+
21
+ 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/robbyant/lingbot-depth> at `f3a237e`.
22
+
23
+ Author weight repos: <https://huggingface.co/robbyant/lingbot-depth-postrain-dc-vitl14>, <https://huggingface.co/robbyant/lingbot-depth-pretrain-vitl-14-v0.5>.
24
+
25
+ Task: depth. Tier: experimental. Outputs: `depth`, `mask`. Backends: `portable`, `kernels`.
26
+
27
+ 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).
28
+
29
+ ## Variants
30
+
31
+ 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/lingbot_depth/card.toml).
32
+
33
+ | variant | weights (author link) | SHA-256 | weights licence | commercial use |
34
+ |---|---|---|---|---|
35
+ | `lingbot-depth@1` | [lingbot-depth-pretrain-vitl-14-v0.5/model.pt](https://huggingface.co/robbyant/lingbot-depth-pretrain-vitl-14-v0.5/resolve/79204ed6b837f4fdd192cf563e59481fecfa0295/model.pt) | `b60cf27ddbd0` | Apache-2.0 | yes |
36
+ | `lingbot-depth-dc@1` | [lingbot-depth-postrain-dc-vitl14/model.pt](https://huggingface.co/robbyant/lingbot-depth-postrain-dc-vitl14/resolve/d1b06f7538d4b56387412799c528542c795df169/model.pt) | `3a4512e05445` | Apache-2.0 | yes |
37
+
38
+ ## Licence
39
+
40
+ Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Licence files: `LICENSE`.
41
+
42
+ Training data: Large-scale real and synthetic RGB-D data with masked depth modelling per the tech report.
43
+
44
+ Licence evidence: https://github.com/robbyant/lingbot-depth/blob/main/LICENSE and the Hugging Face model cards (license: apache-2.0)
45
+
46
+ ## Input size
47
+
48
+ any H x W >= 1, resized or padded inside the model (ViT patch 14)
49
+ Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `lingbot-depth` 3000x4000 (1.7 GiB peak allocated, 2.1 reserved); `lingbot-depth-dc` 3000x4000 (1.7 GiB peak allocated, 2.1 reserved)
50
+
51
+ ## Speed and memory
52
+
53
+ ### Depth, synthetic
54
+
55
+ | model | input | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
56
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
57
+ | `lingbot-depth` | 994x1482 | – | – | 280 | – | – | – | – | 1559 / 1872 | – |
58
+ | `lingbot-depth-dc` | 994x1482 | – | – | 281 | – | – | – | – | 1559 / 1872 | – |
59
+
60
+ ### Startup and first call
61
+
62
+ | model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
63
+ | --- | --- | --- | --- | --- | --- | --- |
64
+ | `lingbot-depth` | – | 1.38 | – | – | 0.53 | – |
65
+ | `lingbot-depth-dc` | – | 1.29 | – | – | 0.53 | – |
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
+ | `lingbot-depth` | 994x1482 | 280 ms | deferred (build >5 min) | 188 ms | – | – | 65.5 s | 1559 / 1872 | – | – | 1821 / 1876 |
72
+ | `lingbot-depth-dc` | 994x1482 | 281 ms | 252 ms | 188 ms | – | 32.4 s | 67.3 s | 1559 / 1872 | 1381 / 1572 | – | 1821 / 1876 |
73
+
74
+ Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
75
+
76
+ 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.
77
+
78
+ ## Accuracy
79
+
80
+ ### Parity with the original code
81
+
82
+ 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`).
83
+
84
+ ## Limitations
85
+
86
+ - The depth map is required: call the model with `prompt_depth=` a metric map in metres (any size, holes as 0 / NaN / inf). Its holes change the ViT's token count, so the kernels mode runs the ViT per image. Export keeps every depth token (masked) and has a fixed size.
87
+
88
+ ## Usage
89
+
90
+ ```python
91
+ from fastforks import depth
92
+
93
+ model = depth.load("lingbot-depth") # mode="auto": the preferred backend from recorded measurements
94
+ result = model("room.jpg")
95
+ result.depth # [H, W] float32 tensor; result.kind says what the maps mean
96
+ # models that take a camera: model("room.jpg", intrinsics=K), K [3, 3] in pixels
97
+ result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
98
+ ```
99
+
100
+ Install with `pip install fastforks` (see <https://github.com/kleinicke/fastforks>). Other variants: `lingbot-depth`, `lingbot-depth-dc`.
101
+
102
+ ## Kernels backend
103
+
104
+ `depth.load("lingbot-depth", 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.
105
+
106
+ <!-- staged from fastforks 1cbf1671 (2026-11-15) -->