Models · Stereo matching

CREStereo

Megvii's cascaded recurrent stereo network, trained on a wide mix of real and synthetic stereo data. Commercially usable.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
crestereo-eth3dMiddlebury 2014 half (994x1482)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
1980
1597
732
229
398
298
1605 / 1870
1541 / 1752
884 / 1030
644 / 732
695 / 748
584 (engine)
Details
  • Original code: https://github.com/megvii-research/CREStereo at ad3a1613bded
  • Code licence: Apache-2.0 (permissive); files: LICENSE
  • Weights licence: Apache-2.0 (assumed from code)
  • Licence evidence: https://github.com/megvii-research/CREStereo/blob/ad3a1613bdedd88b93247e5f002cb7c80799762d/README.md#L82
  • Training data: CREStereo synthetic stereo dataset (Megvii), Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa), MPI Sintel stereo, Middlebury stereo (2014), ETH3D two-view stereo, KITTI stereo 2012 / 2015, NVIDIA Falling Things (FAT), InStereo2K, HR-VS (high-resolution virtual stereo, Yang et al. CVPR 2019) (the datasets original README lists as used for training; which of them the released checkpoint saw is not stated)
  • Options: iters = 20 (>= 1)
  • Kernel libraries: crestereo, fastbb, igev, cutlass_conv, cudnn_hacc
  • Variants: crestereo-eth3d
  • Outputs: disparity
  • Input size: any H x W >= 33, padded to a multiple of 32
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): crestereo-eth3d 3000x4000 (6.4 GiB peak allocated, 8.8 reserved)
  • crestereo-eth3d 994x1482, first call: portable + torch.compile 120 s (cold Inductor cache), TensorRT fp16 224 s (ONNX + engine).
  • crestereo-eth3d original (fp32) 994x1482: PyTorch 2.14.1+cu130, community port ibaiGorordo/CREStereo-Pytorch @ b6c7a9f, test_model.py inference (2 x 20 iters), BGR, pad 32 (edge)
  • crestereo-eth3d original 994x1482: PyTorch 2.14.1+cu130, community port ibaiGorordo/CREStereo-Pytorch @ b6c7a9f, test_model.py inference (2 x 20 iters), BGR, pad 32 (edge), the port's mixed_precision=True
  • crestereo-eth3d load / first call: original 0.05 s / 1.499 s, portable 0.03 s / 0.75† s, kernels 0.03† s / 0.229† 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
crestereo-eth3dETH3D two-view train, bad > 1 px % / EPE1.40 / 0.1851.39 / 0.1851.39 / 0.1841.39 / 0.184trained on this dataset's public images; not a zero-shot result; original = the community PyTorch port (MegEngine 1.13 has no sm_120 build)
crestereo-eth3dMiddlebury 2014 trainingH, bad > 2 px % / EPE4.89 / 0.6934.86 / 0.6934.84 / 0.6994.86 / 0.693trained on this dataset's public images; not a zero-shot result; original = the community PyTorch port (MegEngine 1.13 has no sm_120 build)

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.02 px and p99 <= 0.25 px. On real pairs up to 720x1280 the limits are mean 0.25 / p99 5.0 (precision-sensitive there, see Limitations).

variantkernels error vs original, mean / p99GPU, torchkernels used
crestereo-eth3d0.00231 / 0.03308RTX 5060 Ti, torch 2.14.1+cu130crestereo@4e3c00b2d395:sm_120, cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, fastbb@7d058322634d:sm_120, igev@f075827d68c6:sm_120

Limitations

  • CUDA output (float16, kernels, float32 with PyTorch's default TF32 convolutions) differs from the CPU by ~0.1-0.2 px mean / 3 px p99 at 720x1280, 0.03 px with full float32: rounding amplified by 2 x 20 GRU iterations. Portable and kernels reach the same ETH3D / Middlebury accuracy.