Models · Stereo matching

CFNet

A stereo network with cascaded and fused cost volumes, trained on synthetic data. Commercially usable.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
cfnet-sceneflowMiddlebury 2014 half (994x1482)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
659
545
484
401
249
171
8551 / 8896
6765 / 7880
3441 / 4376
3662 / 4718
1026 / 1398
1238 (engine)
Details
  • Original code: https://github.com/gallenszl/CFNet at 982230dd3605
  • Code licence: MIT (permissive); files: LICENSE
  • Weights licence: MIT (assumed from code)
  • Licence evidence: https://github.com/gallenszl/CFNet/blob/982230dd360583fc35743d0b7ed528982fe5fd38/README.md#L72
  • Training data: Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa)
  • Kernel libraries: igev, cutlass_conv, cudnn_hacc
  • Variants: cfnet-sceneflow
  • Outputs: disparity
  • Input size: any H x W >= 64, padded to a multiple of 64
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): cfnet-sceneflow 1988x2880 (8.2 GiB peak allocated, 11.5 reserved)
  • cfnet-sceneflow 994x1482, first call: portable + torch.compile 53 s (cold Inductor cache), TensorRT fp16 139 s (ONNX + engine).
  • cfnet-sceneflow original 994x1482: torch.autocast(float16) around the call
  • cfnet-sceneflow load / first call: original 0.55 s / 0.56 s, portable 0.94 s / 0.484† s, kernels 0.21† s / 0.402† s
  • † measured in the speed sweep after the portable load (or an earlier size) in the same process: file cache and kernels are warm, so the time is lower than a fresh start.
  • Protocol, median of 5 after 3 warm-up, uint8 CUDA input (synthetic for bench_inputs sizes), card defaults; gc before each load; peak = max over the first call and the timed calls

Measured

Original = the original code named under Details, same checkpoint and protocol.

variantdatasetoriginal fp32original fp16portablekernelsnote
cfnet-sceneflowETH3D two-view train, bad > 1 px % / EPE5.59 / 0.41799.92 / 13.132 (NaN / inf output)5.59 / 0.4175.60 / 0.416
cfnet-sceneflowMiddlebury 2014 trainingH, bad > 2 px % / EPE21.31 / 6.445100.00 / 71.272 (NaN / inf output)21.32 / 6.44721.32 / 6.444

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 468fba10, 2026-11-05.

Parity

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.

variantkernels error vs original, mean / p99GPU, torchkernels used
cfnet-sceneflow0.00193 / 0.0126RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120