Flor commited on
Commit
4eb7e9d
·
0 Parent(s):

fastforks 0.1.0

Browse files
Files changed (2) hide show
  1. .gitattributes +35 -0
  2. README.md +114 -0
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: "fastforks"
3
+ pipeline_tag: "depth-estimation"
4
+ license: "other"
5
+ license_name: "noncommercial"
6
+ license_link: "https://github.com/Junda24/MonSter-plusplus/blob/9167101af8fbe93c706707daa7a8181089c8b1b4/LICENSE#L34"
7
+ tags:
8
+ - "stereo"
9
+ - "stereo-matching"
10
+ - "disparity"
11
+ - "cuda"
12
+ - "pytorch"
13
+ - "fastforks"
14
+ ---
15
+ # RT-MonSter++ (fastforks)
16
+
17
+ RT-MonSter++ (Cheng et al. 2025), the real-time MonSter++: Depth Anything V2 (ViT-S) monocular branch + coarse-to-fine (1/16, 1/8, 1/4) local geometry volumes, stereo and mono ConvGRUs, 4 updates.
18
+
19
+ 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/Junda24/MonSter-plusplus> at `9167101af8fb`.
20
+
21
+ Author weight repos: <https://huggingface.co/cjd24/MonSter-plusplus>.
22
+
23
+ Task: stereo. Tier: experimental. Outputs: `disparity`. Backends: `portable`, `kernels`.
24
+
25
+ Input: a rectified left / right image pair. Output: a disparity map (pixels, left view).
26
+
27
+ ## Variants
28
+
29
+ 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/stereo/models/rt_monster_plusplus/card.toml).
30
+
31
+ | variant | weights (author link) | SHA-256 | weights licence | commercial use |
32
+ |---|---|---|---|---|
33
+ | `rt-monster-plusplus-mix-all@1` | [Zero_shot.pth](https://huggingface.co/cjd24/MonSter-plusplus/resolve/0c140353fa4b0485f08a9d18c2a5c0735188a84b/Zero_shot.pth?download=true) | `0741dd6f622b` | LicenseRef-noncommercial | **no** |
34
+
35
+ ## Licence
36
+
37
+ Original-code strings, recorded as they are (research-use package; check them before any other use). Code: LicenseRef-noncommercial. Files: `LICENSE`.
38
+
39
+ Training data: mix_all (Zero_shot.pth): 'all the datasets we collect over 2M image pairs' (README), not listed.
40
+
41
+ Licence evidence: <https://github.com/Junda24/MonSter-plusplus/blob/9167101af8fbe93c706707daa7a8181089c8b1b4/LICENSE#L34>
42
+
43
+ ## Input size
44
+
45
+ any H x W >= 32, padded to a multiple of 32
46
+ Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `rt-monster-plusplus-mix-all` 1988x2880 (9.3 GiB peak allocated, 11.1 reserved)
47
+
48
+ ## Speed and memory
49
+
50
+ ### Stereo, Middlebury 2014 half, 994x1482
51
+
52
+ | model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
53
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
54
+ | `rt-monster-plusplus-mix-all` | 252 | 251 | 113 | 94.1 | 2.7x | 1.2x | 2922 / 3044 | 2592 / 2646 | 2704 / 3976 |
55
+
56
+ ### Startup and first call
57
+
58
+ | model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
59
+ | --- | --- | --- | --- | --- | --- | --- |
60
+ | `rt-monster-plusplus-mix-all` | 0.99 (375x1242) | 0.26 | 0.23† | 0.66 (375x1242) | 0.13† | 0.10† |
61
+
62
+ ### torch.compile and TensorRT
63
+
64
+ | model | input | portable ms | compile ms | compile s (cold) | TensorRT fp16 ms | ONNX + build s | kernels ms | peak MiB (alloc / reserved): portable | compile | TensorRT (device) |
65
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
66
+ | `rt-monster-plusplus-mix-all` | 994x1482 | 113 | 77.0 | 69.4 | 44.1 | 150 | 94.1 | 2592 / 2646 | 2750 / 2942 | 952 |
67
+
68
+ ### Fixed-size speed and peak memory, all models
69
+
70
+ | model | mode | 480x640 | 720x1280 | 1080x1920 | 12 MP 3000x4000 |
71
+ | --- | --- | --- | --- | --- | --- |
72
+ | `rt-monster-plusplus-mix-all` | portable | 31.2 ms / 609 / 720 | 67.1 ms / 1625 / 1968 | 168.0 ms / 3478 / 4148 | OOM |
73
+ | `rt-monster-plusplus-mix-all` | kernels | 18.3 ms / 630 / 1934 | 57.5 ms / 1660 / 1998 | 140.1 ms / 3545 / 4188 | OOM |
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 authors' code 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
+ ### On public datasets
82
+
83
+ Original = the authors' code, same checkpoint and protocol.
84
+
85
+ | variant | dataset | original fp32 | original fp16 | portable | kernels | note |
86
+ |---|---|---|---|---|---|---|
87
+ | `rt-monster-plusplus-mix-all` | ETH3D two-view train, bad > 1 px % / EPE | 2.05 / 0.226 | 2.05 / 0.226 | 2.05 / 0.226 | 2.05 / 0.226 | possibly in the training data |
88
+ | `rt-monster-plusplus-mix-all` | Middlebury 2014 trainingH, bad > 2 px % / EPE | 11.01 / 1.988 | 11.01 / 1.988 | 11.00 / 1.989 | 11.02 / 1.998 | possibly in the training data |
89
+
90
+ Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-05; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-06.
91
+
92
+ ### Parity with the original code
93
+
94
+ Every variant is checked against reference outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.02 px and p99 <= 0.25 px.
95
+
96
+ ## Usage
97
+
98
+ ```python
99
+ from fastforks import stereo
100
+
101
+ # non-commercial weights: run with FASTFORKS_NONCOMMERCIAL=1 in the environment
102
+ model = stereo.load("rt-monster-plusplus-mix-all") # mode="auto": the preferred backend from recorded measurements
103
+ result = model("left.png", "right.png")
104
+ result.disparity # [H, W] float32 tensor, input resolution
105
+ result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
106
+ ```
107
+
108
+ Install with `pip install fastforks` (see <https://github.com/kleinicke/fastforks>). Other variants: `rt-monster-plusplus-mix-all`.
109
+
110
+ ## Kernels backend
111
+
112
+ `stereo.load("rt-monster-plusplus-mix-all", mode="kernels")` runs our CUDA kernels (`igev`, `cutlass_conv`, `cudnn_hacc`, `fastbb`). 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.
113
+
114
+ <!-- staged from fastforks feccac41 (2026-11-06) -->