GwcNet (fastforks)
GwcNet (Guo et al. 2019): group-wise correlation 3-D cost volume, stacked 3-D hourglasses and soft-argmin regression (max disparity 192).
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/xy-guo/GwcNet at 0987074f48b0.
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.
| variant | weights (author link) | SHA-256 | weights licence | commercial use |
|---|---|---|---|---|
gwcnet-g-sceneflow@1 |
sceneflow/gwcnet-g/checkpoint_000015.ckpt | ea0f406dc1ab |
MIT (assumed from code) | yes |
gwcnet-gc-sceneflow@1 |
sceneflow/gwcnet-gc/checkpoint_000015.ckpt | 95c9647f4896 |
MIT (assumed from code) | yes |
Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: MIT. 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/xy-guo/GwcNet/blob/0987074f48b098c6e975a58ca5aacf233b0fb0eb/README.md#L27
Input size
any H x W >= 32, padded to a multiple of 32
Tested up to (portable, fp16, RTX 5060 Ti 16 GB): gwcnet-g-sceneflow 3000x4000 (13.3 GiB peak allocated, 14.8 reserved); gwcnet-gc-sceneflow 3000x4000 (13.6 GiB peak allocated, 13.7 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 |
|---|---|---|---|---|---|---|---|---|---|
gwcnet-g-sceneflow |
604.3 | 352.4 | 344.24 | 238.13 | 1.5x | 1.4x | 5105 / 5414 | 2081 / 2402 | 1799 / 2102 |
gwcnet-gc-sceneflow |
631.8 | 364.8 | 352.89 | 257.33 | 1.4x | 1.4x | 5887 / 6214 | 2082 / 2402 | 1768 / 1962 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
gwcnet-g-sceneflow |
0.26 (375x1242) | 0.40 | 0.14โ | 0.46 (375x1242) | 0.34โ | 0.24โ |
gwcnet-gc-sceneflow |
0.29 (375x1242) | 0.39 | 0.44โ | 0.12 (375x1242) | 0.35โ | 0.26โ |
torch.compile and TensorRT
| 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) |
|---|---|---|---|---|---|---|---|---|---|---|
gwcnet-g-sceneflow |
994x1482 | 344.24 | 416.6 | 52.6 | 275.4 | 66 | 238.13 | 2081 / 2402 | 1527 / 1864 | 3548 |
Fixed-size speed and peak memory, all models
| model | mode | 640x480 | 1280x720 | 1920x1080 | 12 MP 4000x3000 |
|---|---|---|---|---|---|
gwcnet-g-sceneflow |
portable | 69.2 ms / 418 / 586 | 219.1 ms / 1254 / 1776 | 502.0 ms / 2764 / 3874 | 2911.8 ms (n=3) / 13647 / 15104 |
gwcnet-g-sceneflow |
kernels | 50.9 ms / 393 / 526 | 156.0 ms / 1112 / 1590 | 358.5 ms / 2412 / 3464 | OOM |
gwcnet-gc-sceneflow |
portable | 71.2 ms / 418 / 442 | 224.5 ms / 1255 / 1688 | 514.1 ms / 2766 / 3680 | 2981.7 ms (n=3) / 13924 / 14002 |
gwcnet-gc-sceneflow |
kernels | 54.9 ms / 394 / 468 | 167.5 ms / 1114 / 1534 | 385.9 ms / 2415 / 3300 | OOM |
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
Hardware, protocol and caveats: benchmarks (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.
Accuracy
On public datasets
Original = the authors' code, same checkpoint and protocol.
| variant | dataset | portable | kernels | note |
|---|---|---|---|---|
gwcnet-gc-sceneflow |
ETH3D two-view train, bad > 1 px % / EPE | 10.95 / 1.787 | 10.96 / 1.793 | |
gwcnet-gc-sceneflow |
Middlebury 2014 trainingH, bad > 2 px % / EPE | 25.63 / 6.968 | 25.63 / 6.974 | |
gwcnet-g-sceneflow |
ETH3D two-view train, bad > 1 px % / EPE | 9.60 / 0.624 | 9.59 / 0.621 | |
gwcnet-g-sceneflow |
Middlebury 2014 trainingH, bad > 2 px % / EPE | 25.84 / 6.713 | 25.84 / 6.713 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, 2026-10-27.
Parity with the original code
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.05 px and p99 <= 0.5 px.
Limitations
- The original code's KITTI 2012 / 2015 fine-tuned weights are not included.
- The dominant 3D convolutions run in cuDNN in both modes, so kernels gains less over portable than for other stereo models. Portable is slightly slower than the original code at 994x1482 but allocates less than half the memory.
Usage
from fastforks import stereo
model = stereo.load("gwcnet-g-sceneflow") # 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: gwcnet-g-sceneflow, gwcnet-gc-sceneflow.
Kernels backend
stereo.load("gwcnet-g-sceneflow", 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.