PSMNet (fastforks)
PSMNet (Chang and Chen 2018): spatial-pyramid features, a concatenation 3-D cost volume with three 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/JiaRenChang/PSMNet at 87ac9093afbf.
Task: stereo. Tier: experimental. 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 |
|---|---|---|---|---|
psmnet-sceneflow@1 |
pretrained_sceneflow_new.tar | eb3029f7ed5e |
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/JiaRenChang/PSMNet/blob/87ac9093afbf6545c093bd9d26c5ffd66e49a7b8/README.md#L96-L98
Input size
any H x W >= 241, padded to a multiple of 16
Tested up to (portable, fp16, RTX 5060 Ti 16 GB): psmnet-sceneflow 1988x2880 (7.6 GiB peak allocated, 10.6 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 |
|---|---|---|---|---|---|---|---|---|---|
psmnet-sceneflow |
760 | 608 | 340 | 232 | 2.6x | 1.5x | 6015 / 6090 | 2078 / 2442 | 1786 / 2122 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
psmnet-sceneflow |
0.20 (375x1242) | 0.10 | 0.08โ | 0.53 (375x1242) | 0.35โ | 0.23โ |
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) |
|---|---|---|---|---|---|---|---|---|---|---|
psmnet-sceneflow |
994x1482 | 340 | 439.9 | 60.0 | 668.8 | 89 | 232 | 2078 / 2442 | 1760 / 2082 | 1528 |
Fixed-size speed and peak memory, all models
| model | mode | 480x640 | 720x1280 | 1080x1920 | 12 MP 3000x4000 |
|---|---|---|---|---|---|
psmnet-sceneflow |
portable | 69.0 ms / 426 / 606 | 206.2 ms / 1256 / 1780 | 479.2 ms / 2834 / 3966 | OOM |
psmnet-sceneflow |
kernels | 49.6 ms / 415 / 518 | 140.3 ms / 1108 / 1414 | 329.2 ms / 2459 / 3104 | 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 | original fp32 | original fp16 | portable | kernels | note |
|---|---|---|---|---|---|---|
psmnet-sceneflow |
ETH3D two-view train, bad > 1 px % / EPE | 15.14 / 2.152 | 15.13 / 2.152 | 15.11 / 2.154 | 15.13 / 2.148 | |
psmnet-sceneflow |
Middlebury 2014 trainingH, bad > 2 px % / EPE | 36.06 / 11.482 | 36.06 / 11.484 | 36.06 / 11.484 | 36.07 / 11.482 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, 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.05 px and p99 <= 0.5 px.
Usage
from fastforks import stereo
model = stereo.load("psmnet-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: psmnet-sceneflow.
Kernels backend
stereo.load("psmnet-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.