Flor commited on
Commit
34d1bbf
Β·
verified Β·
1 Parent(s): bcf9c84

card: update from fastforks 1cbf1671

Browse files
Files changed (1) hide show
  1. README.md +131 -0
README.md ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: "fastforks"
3
+ pipeline_tag: "depth-estimation"
4
+ license: "other"
5
+ license_name: "dinov3-license"
6
+ license_link: "https://github.com/google-research/pointdit/blob/11f53a30aeb4d34d49d2beda655ee6f19b2ad7f8/LICENSE"
7
+ tags:
8
+ - "depth"
9
+ - "mono-depth"
10
+ - "monocular-depth"
11
+ - "cuda"
12
+ - "pytorch"
13
+ - "fastforks"
14
+ - "fastforks-card"
15
+ ---
16
+ # PointDiT (fastforks)
17
+
18
+ PointDiT (Xu et al., Google 2026): monocular geometry as generation; a pixel-space diffusion transformer denoises a point map in 3 Euler steps, conditioned on frozen DINOv3 features of the image. Outputs an affine-invariant point map and its depth.
19
+
20
+ 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/google-research/pointdit> at `11f53a30aeb4`.
21
+
22
+ Author weight repos: <https://huggingface.co/facebook/dinov3-vitb16-pretrain-lvd1689m>, <https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m>, <https://huggingface.co/haofeixu/pointdit>.
23
+
24
+ Task: depth. Tier: experimental. Outputs: `points`, `depth`. Backends: `portable`, `kernels`.
25
+
26
+ 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).
27
+
28
+ ## Variants
29
+
30
+ 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/pointdit/card.toml).
31
+
32
+ | variant | weights (author link) | SHA-256 | weights licence | commercial use |
33
+ |---|---|---|---|---|
34
+ | `pointdit-b-512@1` | [dinov3-vitb16-pretrain-lvd1689m/model.safetensors](https://huggingface.co/facebook/dinov3-vitb16-pretrain-lvd1689m/resolve/5931719e67bbdb9737e363e781fb0c67687896bc/model.safetensors)<br>[pointditb-512-mixdata-nodinov3-1d42aacf.pth](https://huggingface.co/haofeixu/pointdit/resolve/956a6f4279c20b59adfc1ea2038603514f4fe5dc/pointditb-512-mixdata-nodinov3-1d42aacf.pth) | `9a21ac3df0c6`<br>`1d42aacfd6aa` | LicenseRef-DINOv3-License | yes |
35
+ | `pointdit-l-512@1` | [dinov3-vitl16-pretrain-lvd1689m/model.safetensors](https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m/resolve/ea8dc2863c51be0a264bab82070e3e8836b02d51/model.safetensors)<br>[pointditl-512-mixdata-nodinov3-240c1a4f.pth](https://huggingface.co/haofeixu/pointdit/resolve/956a6f4279c20b59adfc1ea2038603514f4fe5dc/pointditl-512-mixdata-nodinov3-240c1a4f.pth) | `dcb2e45127cc`<br>`240c1a4fc9a2` | LicenseRef-DINOv3-License | yes |
36
+
37
+ ## Licence
38
+
39
+ Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Licence files: `LICENSE`.
40
+
41
+ Training data: Mixture of synthetic and real point-map datasets ("mixdata") per the PointDiT paper; the DINOv3 encoder: LVD-1689M (not released).
42
+
43
+ - Licence note: The PointDiT code and weights are Apache-2.0; the frozen DINOv3 ViT-B/16 and ViT-L/16 encoders are under the DINOv3 License (Meta: attribution and conditions apply; gated on Hugging Face); read it before commercial use.
44
+
45
+ Licence evidence: https://github.com/google-research/pointdit/blob/11f53a30aeb4d34d49d2beda655ee6f19b2ad7f8/LICENSE (Apache-2.0); https://huggingface.co/haofeixu/pointdit (license: apache-2.0); encoder: https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m (DINOv3 License, gated)
46
+
47
+ ## Input size
48
+
49
+ any H x W >= 1, resized or padded inside the model
50
+ Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `pointdit-b-512` 3000x4000 (0.8 GiB peak allocated, 1.0 reserved); `pointdit-l-512` 3000x4000 (1.6 GiB peak allocated, 2.2 reserved)
51
+
52
+ ## Speed and memory
53
+
54
+ ### Depth, synthetic
55
+
56
+ | model | input | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
57
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
58
+ | `pointdit-b-512` | 518x770 | – | – | 30.7 | 20.5 | – | 1.5x | – | 432 / 484 | 434 / 590 |
59
+ | `pointdit-l-512` | 518x770 | – | – | 94.2 | 61.0 | – | 1.5x | – | 1285 / 1410 | 1314 / 1656 |
60
+
61
+ ### Depth, Middlebury 2014 half, 994x1482
62
+
63
+ | model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
64
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
65
+ | `pointdit-b-512` | 105 | 48.7 | 30.7 | 20.6 | 2.4x | 1.5x | 1214 / 1246 | 450 / 544 | 466 / 630 |
66
+ | `pointdit-l-512` | 335 | 112 | 94.6 | 61.4 | 1.8x | 1.5x | 3953 / 4010 | 1301 / 1410 | 1314 / 1696 |
67
+
68
+ ### Startup and first call
69
+
70
+ | model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
71
+ | --- | --- | --- | --- | --- | --- | --- |
72
+ | `pointdit-b-512` | 2.57 | 0.65 (518x770) | 0.56 (518x770) | 0.11 | 0.29 (518x770) | 0.17 (518x770) |
73
+ | `pointdit-l-512` | 9.47 | 0.92 (518x770) | 0.94 (518x770) | 0.12 | 0.27 (518x770) | 0.25 (518x770) |
74
+
75
+ ### torch.compile and TensorRT
76
+
77
+ | 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) |
78
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
79
+ | `pointdit-b-512` | 994x1482 | 30.7 ms | 23.7 ms | fails: BackendUnavailableError: onnx is not installed: pip install | 20.6 ms | 33.6 s | – | 450 / 544 | 465 / 524 | 466 / 630 | – |
80
+
81
+ Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
82
+
83
+ 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.
84
+
85
+ ## Accuracy
86
+
87
+ ### On public datasets
88
+
89
+ AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Original = the original code named under Details, same checkpoint and protocol.
90
+
91
+ | variant | dataset | original fp32 | original fp16 | portable | kernels | note |
92
+ |---|---|---|---|---|---|---|
93
+ | `pointdit-b-512` | NYUv2 test, AbsRel / delta1 | 0.0453 / 0.9773 | 0.0454 / 0.9773 | 0.0453 / 0.9773 | 0.0453 / 0.9773 | |
94
+ | `pointdit-b-512` | iBims-1, AbsRel / delta1 | 0.0374 / 0.9821 | 0.0374 / 0.9820 | 0.0374 / 0.9821 | 0.0374 / 0.9821 | |
95
+ | `pointdit-b-512` | ETH3D two-view train left, AbsRel / delta1 | 0.0896 / 0.9085 | 0.0896 / 0.9086 | 0.0896 / 0.9086 | 0.0896 / 0.9085 | possibly in the training data |
96
+ | `pointdit-b-512` | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0313 / 0.9948 | 0.0313 / 0.9948 | 0.0313 / 0.9948 | 0.0313 / 0.9948 | possibly in the training data |
97
+ | `pointdit-l-512` | NYUv2 test, AbsRel / delta1 | 0.0410 / 0.9800 | 0.0411 / 0.9800 | 0.0410 / 0.9800 | 0.0410 / 0.9800 | |
98
+ | `pointdit-l-512` | iBims-1, AbsRel / delta1 | 0.0313 / 0.9848 | 0.0313 / 0.9847 | 0.0313 / 0.9848 | 0.0313 / 0.9848 | |
99
+ | `pointdit-l-512` | ETH3D two-view train left, AbsRel / delta1 | 0.0748 / 0.9264 | 0.0748 / 0.9278 | 0.0748 / 0.9265 | 0.0748 / 0.9261 | possibly in the training data |
100
+ | `pointdit-l-512` | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0230 / 0.9952 | 0.0230 / 0.9951 | 0.0230 / 0.9952 | 0.0230 / 0.9952 | possibly in the training data |
101
+
102
+ Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 2fb984b3, 2026-11-15.
103
+
104
+ ### Parity with the original code
105
+
106
+ Every variant is checked against reference outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 1.5e-06 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.00029 and p99 <= 0.0012 (absolute error of the output `points`).
107
+
108
+ ## Limitations
109
+
110
+ - Affine-invariant output: points up to an unknown scale and 3-D shift, depth (their z) up to scale and shift; align before use.
111
+ - Trained at 512 x 512: inputs are resized to about `tokens` 16-pixel patches at their aspect ratio (bilinear) and the point map is resized back with nearest, as the original's wild-image path.
112
+
113
+ ## Usage
114
+
115
+ ```python
116
+ from fastforks import depth
117
+
118
+ model = depth.load("pointdit-b-512") # mode="auto": the preferred backend from recorded measurements
119
+ result = model("room.jpg")
120
+ result.points # [H, W] float32 tensor; result.kind says what the maps mean
121
+ # models that take a camera: model("room.jpg", intrinsics=K), K [3, 3] in pixels
122
+ result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
123
+ ```
124
+
125
+ Install with `pip install fastforks` (see <https://github.com/kleinicke/fastforks>). Other variants: `pointdit-b-512`, `pointdit-l-512`.
126
+
127
+ ## Kernels backend
128
+
129
+ `depth.load("pointdit-b-512", 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.
130
+
131
+ <!-- staged from fastforks 1cbf1671 (2026-11-15) -->