File size: 13,339 Bytes
12e32fe e447a3a 12e32fe e447a3a 12e32fe bbffb60 12e32fe e447a3a 12e32fe bbffb60 12e32fe bbffb60 12e32fe bbffb60 12e32fe bbffb60 12e32fe e447a3a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | ---
library_name: "fastforks"
pipeline_tag: "depth-estimation"
license: "other"
license_name: "see-model-card"
license_link: "https://github.com/Windsrain/Selective-Stereo/blob/c39acbfef9fbe36fbc01efa4abeafc62bbe2da36/README.md#L25"
tags:
- "stereo"
- "stereo-matching"
- "disparity"
- "cuda"
- "pytorch"
- "fastforks"
- "fastforks-card"
---
# Selective-IGEV (fastforks)
Selective-IGEV (Wang et al. 2024, Selective-Stereo): IGEV-Stereo with selective recurrent units, attention-blended small (1x1) and large (3x3) ConvGRUs on a channel- and spatially re-weighted context, 32 iterations.
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/Windsrain/Selective-Stereo> at `c39acbfef9fb`.
Task: stereo. Tier: stable. Outputs: `disparity`. Backends: `portable`, `kernels`.
Input: a rectified left / right image pair. Output: a disparity map (pixels, left view).
## Variants
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/selective_igev/card.toml).
| variant | weights (author link) | SHA-256 | weights licence | commercial use |
|---|---|---|---|---|
| `selective-igev-eth3d-finetune@1` | [eth3d_finetune.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1fHtm5bno6usdcKEYLgH__yBLhMYDz0fs) | `29d62b91c58e` | MIT (assumed from code) | yes |
| `selective-igev-eth3d-train@1` | [eth3d_train.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1IQ6eP7oVy2MfRB9pIU0afPiXhnBT4QbG) | `989327ad0220` | MIT (assumed from code) | yes |
| `selective-igev-kitti12@1` | [kitti12.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1FS5LapV8uP19hce5pXw0wXMf7ZTz0djf) | `3a9ed6f2e778` | MIT (assumed from code) | yes |
| `selective-igev-kitti15@1` | [kitti15.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1ewtQTWvmPa4iGlRzIq4fcfk78LIq-Rim) | `488254b5cfbf` | MIT (assumed from code) | yes |
| `selective-igev-middlebury-finetune@1` | [middlebury_finetune.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1eBi5DC_mFfMNjvA13XhxpHkoP2ScUTqN) | `ce019e97bbe8` | MIT (assumed from code) | yes |
| `selective-igev-middlebury-train@1` | [middlebury_train.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1WDFD3qNaklB_OQDxHAdnMFNWCd678iAI) | `a51f67029d77` | MIT (assumed from code) | yes |
| `selective-igev-sceneflow@1` | [sceneflow.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1N0VfCFcAwSEPeXdWcrSS0JlNa4xm2gIn) | `27286b184d68` | MIT (assumed from code) | yes |
## Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: MIT. Licence files: `LICENSE`.
Code licence: MIT; the authors do not state a separate weights licence.
Training data: Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa).
Licence evidence: <https://github.com/Windsrain/Selective-Stereo/blob/c39acbfef9fbe36fbc01efa4abeafc62bbe2da36/README.md#L25>
## Input size
any H x W >= 32, padded to a multiple of 32
Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `selective-igev-eth3d-finetune` 3000x4000 (10.3 GiB peak allocated, 14.0 reserved); `selective-igev-eth3d-train` 3000x4000 (10.3 GiB peak allocated, 14.0 reserved); `selective-igev-kitti12` 3000x4000 (10.3 GiB peak allocated, 14.0 reserved); `selective-igev-kitti15` 3000x4000 (10.3 GiB peak allocated, 14.0 reserved); `selective-igev-middlebury-finetune` 3000x4000 (10.3 GiB peak allocated, 14.0 reserved); `selective-igev-middlebury-train` 3000x4000 (10.3 GiB peak allocated, 14.0 reserved); `selective-igev-sceneflow` 3000x4000 (10.3 GiB peak allocated, 14.0 reserved)
## Speed and memory
### Stereo, Middlebury 2014 half, 994x1482
| model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| `selective-igev-eth3d-finetune` | 2201 | 1455 | 998 | 349 | 4.2x | 2.9x | 2013 / 2152 | 1238 / 1488 | 1109 / 1390 |
### Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
| --- | --- | --- | --- | --- | --- | --- |
| `selective-igev-eth3d-finetune` | 0.36 (375x1242) | 0.50 | 0.14† | 2.25 (375x1242) | 1.02† | 0.35† |
### torch.compile and TensorRT
| 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) |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| `selective-igev-eth3d-finetune` | 994x1482 | 998 ms | 691 ms | 461 ms | 349 ms | 126 s | 256 s | 1238 / 1488 | 919 / 1088 | 1109 / 1390 | 1279 / 1316 |
| `selective-igev-eth3d-train` | 994x1482 | 998 ms | 691 ms | 462 ms | 349 ms | 127 s | 260 s | 1238 / 1488 | 915 / 1028 | 1109 / 1390 | 1278 / 1334 |
| `selective-igev-kitti12` | 994x1482 | 998 ms | 691 ms | 462 ms | 349 ms | 125 s | 255 s | 1238 / 1488 | 915 / 1028 | 1109 / 1390 | 1278 / 1334 |
| `selective-igev-kitti15` | 994x1482 | 998 ms | 691 ms | 462 ms | 349 ms | 127 s | 256 s | 1238 / 1488 | 915 / 1028 | 1109 / 1390 | 1278 / 1334 |
| `selective-igev-middlebury-finetune` | 994x1482 | 998 ms | 692 ms | 462 ms | 349 ms | 127 s | 258 s | 1238 / 1488 | 915 / 1028 | 1109 / 1390 | 1280 / 1316 |
| `selective-igev-middlebury-train` | 994x1482 | 998 ms | 692 ms | 462 ms | 349 ms | 128 s | 256 s | 1238 / 1488 | 915 / 1028 | 1109 / 1390 | 1278 / 1334 |
| `selective-igev-sceneflow` | 994x1482 | 998 ms | 692 ms | 463 ms | 349 ms | 127 s | 255 s | 1238 / 1488 | 915 / 1028 | 1109 / 1390 | 1278 / 1334 |
### Fixed-size speed and peak memory, all models
| model | mode | 480x640 | 720x1280 | 1080x1920 | 12 MP 3000x4000 |
| --- | --- | --- | --- | --- | --- |
| `selective-igev-eth3d-finetune` | portable | 190.5 ms / 282 / 362 | 575.3 ms / 769 / 1036 | 1420.2 ms / 1690 / 2030 | 8918.7 ms (n=3) / 10549 / 14320 |
| `selective-igev-eth3d-finetune` | kernels | 82.5 ms / 260 / 368 | 212.8 ms / 693 / 1010 | 472.5 ms / 1502 / 2046 | 2806.7 ms (n=3) / 6928 / 8800 |
| `selective-igev-eth3d-train` | portable | 190.5 ms / 282 / 362 | 575.3 ms / 769 / 1036 | 1420.4 ms / 1690 / 2030 | 8919.8 ms (n=3) / 10549 / 14320 |
| `selective-igev-eth3d-train` | kernels | 82.4 ms / 260 / 368 | 212.8 ms / 693 / 1010 | 472.6 ms / 1502 / 2046 | 2807.0 ms (n=3) / 6928 / 8800 |
| `selective-igev-kitti12` | portable | 190.6 ms / 282 / 362 | 575.3 ms / 769 / 1036 | 1420.5 ms / 1690 / 2030 | 8917.7 ms (n=3) / 10549 / 14320 |
| `selective-igev-kitti12` | kernels | 82.3 ms / 260 / 368 | 212.9 ms / 693 / 1010 | 471.9 ms / 1502 / 2046 | 2803.4 ms (n=3) / 6928 / 8800 |
| `selective-igev-kitti15` | portable | 190.6 ms / 282 / 362 | 575.3 ms / 769 / 1036 | 1420.8 ms / 1690 / 2030 | 8918.8 ms (n=3) / 10549 / 14320 |
| `selective-igev-kitti15` | kernels | 82.5 ms / 260 / 368 | 212.8 ms / 693 / 1010 | 471.9 ms / 1502 / 2046 | 2803.9 ms (n=3) / 6928 / 8800 |
| `selective-igev-middlebury-finetune` | portable | 190.6 ms / 282 / 362 | 575.6 ms / 769 / 1036 | 1420.8 ms / 1690 / 2030 | 8923.1 ms (n=3) / 10549 / 14320 |
| `selective-igev-middlebury-finetune` | kernels | 82.3 ms / 260 / 368 | 212.6 ms / 693 / 1010 | 472.1 ms / 1502 / 2046 | 2804.4 ms (n=3) / 6928 / 8800 |
| `selective-igev-middlebury-train` | portable | 190.7 ms / 282 / 362 | 575.4 ms / 769 / 1036 | 1420.5 ms / 1690 / 2030 | 8921.4 ms (n=3) / 10549 / 14320 |
| `selective-igev-middlebury-train` | kernels | 82.5 ms / 260 / 368 | 213.1 ms / 693 / 1010 | 472.4 ms / 1502 / 2046 | 2804.8 ms (n=3) / 6928 / 8800 |
| `selective-igev-sceneflow` | portable | 190.6 ms / 282 / 362 | 575.4 ms / 769 / 1036 | 1420.3 ms / 1690 / 2030 | 8917.6 ms (n=3) / 10549 / 14320 |
| `selective-igev-sceneflow` | kernels | 82.5 ms / 260 / 368 | 213.5 ms / 693 / 1010 | 473.3 ms / 1502 / 2046 | 2808.4 ms (n=3) / 6928 / 8800 |
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
- `selective-igev-eth3d-train`, `selective-igev-kitti12`, `selective-igev-kitti15`, `selective-igev-middlebury-finetune`, `selective-igev-middlebury-train`, `selective-igev-sceneflow`: same network and settings as `selective-igev-eth3d-finetune`, measured once (rows not repeated).
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.
## Accuracy
### On public datasets
Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | kernels | note |
|---|---|---|---|---|---|---|
| `selective-igev-sceneflow` | ETH3D two-view train, bad > 1 px % / EPE | 6.08 / 1.426 | 6.06 / 1.405 | 6.05 / 1.401 | 6.06 / 1.410 | |
| `selective-igev-sceneflow` | Middlebury 2014 trainingH, bad > 2 px % / EPE | 11.78 / 2.584 | 11.77 / 2.571 | 11.81 / 2.591 | 11.80 / 2.591 | |
| `selective-igev-kitti12` | ETH3D two-view train, bad > 1 px % / EPE | 24.09 / 3.655 | 24.07 / 3.663 | 24.07 / 3.649 | 24.07 / 3.662 | |
| `selective-igev-kitti12` | Middlebury 2014 trainingH, bad > 2 px % / EPE | 20.09 / 4.854 | 20.09 / 4.862 | 20.08 / 4.845 | 20.09 / 4.862 | |
| `selective-igev-kitti15` | ETH3D two-view train, bad > 1 px % / EPE | 24.25 / 2.449 | 24.26 / 2.445 | 24.26 / 2.445 | 24.26 / 2.456 | |
| `selective-igev-kitti15` | Middlebury 2014 trainingH, bad > 2 px % / EPE | 19.64 / 4.949 | 19.64 / 4.952 | 19.65 / 4.956 | 19.64 / 4.941 | |
| `selective-igev-middlebury-finetune` | ETH3D two-view train, bad > 1 px % / EPE | 24.24 / 0.995 | 24.24 / 0.994 | 24.27 / 0.995 | 24.24 / 0.995 | |
| `selective-igev-middlebury-finetune` | Middlebury 2014 trainingH, bad > 2 px % / EPE | 5.65 / 1.192 | 5.66 / 1.192 | 5.66 / 1.208 | 5.67 / 1.194 | trained on this dataset's public images; not a zero-shot result |
| `selective-igev-middlebury-train` | ETH3D two-view train, bad > 1 px % / EPE | 10.28 / 0.434 | 10.24 / 0.433 | 10.24 / 0.433 | 10.25 / 0.433 | |
| `selective-igev-middlebury-train` | Middlebury 2014 trainingH, bad > 2 px % / EPE | 5.95 / 1.437 | 5.96 / 1.433 | 5.97 / 1.435 | 5.99 / 1.437 | trained on this dataset's public images; not a zero-shot result |
| `selective-igev-eth3d-finetune` | ETH3D two-view train, bad > 1 px % / EPE | 0.32 / 0.082 | 0.32 / 0.082 | 0.32 / 0.082 | 0.32 / 0.082 | trained on this dataset's public images; not a zero-shot result |
| `selective-igev-eth3d-finetune` | Middlebury 2014 trainingH, bad > 2 px % / EPE | 12.33 / 2.813 | 12.33 / 2.808 | 12.33 / 2.807 | 12.34 / 2.811 | |
| `selective-igev-eth3d-train` | ETH3D two-view train, bad > 1 px % / EPE | 0.78 / 0.137 | 0.78 / 0.137 | 0.78 / 0.137 | 0.78 / 0.137 | trained on this dataset's public images; not a zero-shot result |
| `selective-igev-eth3d-train` | Middlebury 2014 trainingH, bad > 2 px % / EPE | 7.96 / 2.158 | 7.97 / 2.153 | 7.99 / 2.161 | 8.01 / 2.158 | |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 468fba10, 2026-11-05.
### Parity with the original code
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.
## Limitations
- ONNX export needs torch >= 2.14 (older exporters fail on this network).
## Usage
```python
from fastforks import stereo
model = stereo.load("selective-igev-eth3d-finetune") # mode="auto": the preferred backend from recorded measurements
result = model("left.png", "right.png")
result.disparity # [H, W] float32 tensor, input resolution
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
```
Install with `pip install fastforks` (see <https://github.com/kleinicke/fastforks>). Other variants: `selective-igev-eth3d-finetune`, `selective-igev-eth3d-train`, `selective-igev-kitti12`, `selective-igev-kitti15`, `selective-igev-middlebury-finetune`, `selective-igev-middlebury-train`, `selective-igev-sceneflow`.
## Kernels backend
`stereo.load("selective-igev-eth3d-finetune", mode="kernels")` runs our CUDA kernels (`igev`, `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.
<!-- staged from fastforks 1cbf1671 (2026-11-15) -->
|