Flor commited on
Commit
fa8b576
·
0 Parent(s):

fastforks 0.1.0

Browse files
Files changed (2) hide show
  1. .gitattributes +35 -0
  2. README.md +112 -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,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: "fastforks"
3
+ pipeline_tag: "depth-estimation"
4
+ license: "other"
5
+ license_name: "mit-code-weights-unstated"
6
+ license_link: "https://github.com/gangweix/IGEV-plusplus/blob/099dec97989780d151700459c682df1cc2c18e88/README.md#L23"
7
+ tags:
8
+ - "stereo"
9
+ - "stereo-matching"
10
+ - "disparity"
11
+ - "cuda"
12
+ - "pytorch"
13
+ - "fastforks"
14
+ ---
15
+ # IGEV++ (fastforks)
16
+
17
+ IGEV++ (Xu et al. 2025): IGEV-Stereo with geometry encoding volumes for small, medium and large disparity ranges (48 bins each at 1/4 resolution, up to 768 px), aggregated separately and blended per pixel in the ConvGRU update, 32 iterations.
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/gangweix/IGEV-plusplus> at `099dec979897`.
20
+
21
+ Task: stereo. Tier: experimental. Outputs: `disparity`. Backends: `portable`, `kernels`.
22
+
23
+ Input: a rectified left / right image pair. Output: a disparity map (pixels, left view).
24
+
25
+ ## Variants
26
+
27
+ 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/igev_plusplus/card.toml).
28
+
29
+ | variant | weights (author link) | SHA-256 | weights licence | commercial use |
30
+ |---|---|---|---|---|
31
+ | `igev-plusplus-eth3d@1` | [eth3d.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1gN8J9YVJMupJVjUAUMSJ0jldkqH1YJUo) | `4595ac1c164b` | MIT (assumed from code) | yes |
32
+ | `igev-plusplus-kitti12@1` | [kitti2012.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1j5grw6AKhwhJNWJXn_RfhpFfiWBYboqH) | `2e7947101eec` | MIT (assumed from code) | yes |
33
+ | `igev-plusplus-kitti15@1` | [kitti2015.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=15kWs23CO4bBDy3DJE4kNv_tlbeEvp1bk) | `42db237df5f8` | MIT (assumed from code) | yes |
34
+ | `igev-plusplus-middlebury@1` | [middlebury.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1R9a2YP4kaAv4oT0wtwTnWXrb82Shpp3O) | `eecddfa4549d` | MIT (assumed from code) | yes |
35
+ | `igev-plusplus-sceneflow@1` | [sceneflow.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1n8tu7eoByY_Xpyox5XJnjJC_bGBM2r4M) | `550227fb7b73` | MIT (assumed from code) | yes |
36
+
37
+ ## Licence
38
+
39
+ Original-code strings, recorded as they are (research-use package; check them before any other use). Code: MIT. Files: `LICENSE`.
40
+
41
+ Code licence: MIT; the authors do not state a separate weights licence.
42
+
43
+ Training data: Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa).
44
+
45
+ Licence evidence: <https://github.com/gangweix/IGEV-plusplus/blob/099dec97989780d151700459c682df1cc2c18e88/README.md#L23>
46
+
47
+ ## Input size
48
+
49
+ any H x W >= 32, padded to a multiple of 32
50
+ Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `igev-plusplus-eth3d` not measured yet; `igev-plusplus-kitti12` not measured yet; `igev-plusplus-kitti15` not measured yet; `igev-plusplus-middlebury` not measured yet; `igev-plusplus-sceneflow` not measured yet
51
+
52
+ ## Speed and memory
53
+
54
+ ### Stereo, Middlebury 2014 half, 994x1482
55
+
56
+ | model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
57
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
58
+ | `igev-plusplus-eth3d` | 2012.16 | 1277.86 | 1080.64 | 393.04 | 3.3x | 2.7x | 2891 / 3108 | 1594 / 1840 | 1389 / 2302 |
59
+
60
+ ### Startup and first call
61
+
62
+ | model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
63
+ | --- | --- | --- | --- | --- | --- | --- |
64
+ | `igev-plusplus-eth3d` | 0.42 (375x1242) | 0.20 | 0.16† | 2.33 (375x1242) | 1.10† | 0.40† |
65
+
66
+ ### Fixed-size speed and peak memory, all models
67
+
68
+ | model | mode | 640x480 | 1280x720 | 1920x1080 | 12 MP 4000x3000 |
69
+ | --- | --- | --- | --- | --- | --- |
70
+ | `igev-plusplus-eth3d` | portable | 201.5 ms / 354 / 614 | 606.5 ms / 987 / 1662 | 1534.8 ms / 2172 / 3496 | OOM |
71
+ | `igev-plusplus-eth3d` | kernels | 88.7 ms / 357 / 1092 | 241.2 ms / 830 / 1210 | 534.3 ms / 1799 / 2464 | 3135.8 ms (n=3) / 8419 / 9752 |
72
+ | `igev-plusplus-kitti12` | portable | 201.4 ms / 354 / 614 | 607.2 ms / 987 / 1662 | 1535.8 ms / 2172 / 3496 | OOM |
73
+ | `igev-plusplus-kitti12` | kernels | 89.1 ms / 357 / 1092 | 244.8 ms / 830 / 1210 | 535.9 ms / 1799 / 2464 | 3143.3 ms (n=3) / 8419 / 9750 |
74
+ | `igev-plusplus-kitti15` | portable | 202.7 ms / 354 / 614 | 606.9 ms / 987 / 1662 | 1535.8 ms / 2172 / 3496 | OOM |
75
+ | `igev-plusplus-kitti15` | kernels | 88.7 ms / 357 / 1092 | 240.2 ms / 830 / 1210 | 534.9 ms / 1799 / 2464 | 3141.8 ms (n=3) / 8419 / 9752 |
76
+ | `igev-plusplus-middlebury` | portable | 201.2 ms / 354 / 612 | 606.8 ms / 987 / 1662 | 1535.6 ms / 2172 / 3496 | OOM |
77
+ | `igev-plusplus-middlebury` | kernels | 88.7 ms / 357 / 1092 | 240.5 ms / 830 / 1210 | 535.0 ms / 1799 / 2464 | 3140.6 ms (n=3) / 8419 / 9752 |
78
+ | `igev-plusplus-sceneflow` | portable | 201.0 ms / 354 / 612 | 606.2 ms / 987 / 1662 | 1534.9 ms / 2172 / 3496 | OOM |
79
+ | `igev-plusplus-sceneflow` | kernels | 88.6 ms / 357 / 1092 | 240.6 ms / 830 / 1210 | 535.4 ms / 1799 / 2464 | 3143.9 ms (n=3) / 8419 / 9752 |
80
+
81
+ Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
82
+
83
+ - `igev-plusplus-kitti12`, `igev-plusplus-kitti15`, `igev-plusplus-middlebury`, `igev-plusplus-sceneflow`: same network and settings as `igev-plusplus-eth3d`, measured once (rows not repeated).
84
+
85
+ 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.
86
+
87
+ ## Accuracy
88
+
89
+ ### Parity with the original code
90
+
91
+ Every variant is checked against golden 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.
92
+
93
+ ## Limitations
94
+
95
+ - CUDA output (float16, kernels, float32 with PyTorch's default TF32 convolutions) differs from the CPU by ~0.06 px mean / 1.2 px p99 at 720x1280, 0.005 px with full float32: rounding amplified by 32 GRU iterations. Portable and kernels reach the same ETH3D / Middlebury accuracy.
96
+
97
+ ## Usage
98
+
99
+ ```python
100
+ from fastforks import stereo
101
+
102
+ model = stereo.load("igev-plusplus-eth3d") # portable PyTorch on the GPU if there is one, else the CPU
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: `igev-plusplus-eth3d`, `igev-plusplus-kitti12`, `igev-plusplus-kitti15`, `igev-plusplus-middlebury`, `igev-plusplus-sceneflow`.
109
+
110
+ ## Kernels backend
111
+
112
+ `stereo.load("igev-plusplus-eth3d", mode="kernels")` runs our CUDA kernels (`igev`, `igevpp`, `cutlass_conv`, `cudnn_hacc`). 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.