C-FoundationStereo (fastforks)

NVIDIA's commercially licensed FoundationStereo releases (TAO code): C-FoundationStereo-S (DepthAnything-ViT-S + CNN features, 3D cost-volume filtering with disparity transformer, ConvGRU, 22 iterations), the distilled C-Fast-FoundationStereo (EdgeNeXt features, 8 iterations) and the same network with the research checkpoint (Fast-FoundationStereo).

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/NVIDIA/tao_pytorch_backend at 77fb1a4bca02.

Author weight repos: https://huggingface.co/nvidia/c-fast-foundationstereo, https://huggingface.co/nvidia/c-foundationstereo-s.

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
c-fast-foundationstereo@1 model_best_bp2_serialize.pth 7aee85948373 LicenseRef-NVIDIA-Open-Model-Agreement yes
c-foundationstereo-s@1 trainable_foundation_stereo_small.pth 5e578fdf1105 LicenseRef-NVIDIA-Open-Model-License yes
fast-foundationstereo@1 23-36-37/model_best_bp2_serialize.pth af0658f289ec LicenseRef-NVIDIA-Source-Code-License-NC no

Licence

Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Files: LICENSE.

Training data: Foundation Stereo Dataset (FSD, NVIDIA synthetic), CREStereo synthetic stereo dataset (Megvii), TartanAir (pretrained on the Foundation Stereo Dataset (FSD, NVIDIA synthetic) and CREStereo, fine-tuned on FSD and TartanAir).

  • Licence note: fast-foundationstereo is the research checkpoint 23-36-37 (the original demo default, the most accurate released): weights are non-commercial (NVIDIA Source Code License NC); our code here is the Apache-2.0 TAO code, which does not change that. For commercial use take c-foundationstereo-s (its model card says 'ready for commercial use').
  • Licence note: Trained on NVIDIA's FSD dataset, whose terms for commercial use of trained models are unclear; the status does not depend on the training data.
  • Licence note: c-fast-foundationstereo: the weights are governed by the NVIDIA Open Model Agreement, which allows commercial use; the model card's description also calls the model 'for research and evaluation purposes only', which contradicts it. We follow the governing terms.

Licence evidence: https://huggingface.co/nvidia/c-foundationstereo-s/blob/d776ba855977e99cc9f16246f911d701da0bbc7a/README.md

Input size

any H x W >= 32, padded to a multiple of 32 Tested up to (portable, fp16, RTX 5060 Ti 16 GB): c-fast-foundationstereo 1988x2880 (9.3 GiB peak allocated, 12.3 reserved); c-foundationstereo-s 1024x2048 (8.3 GiB peak allocated, 11.1 reserved); fast-foundationstereo 1988x2880 (9.3 GiB peak allocated, 12.3 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
c-fast-foundationstereo (max_disp 192, valid_iters 8) 741.3 527.1 329.75 134.91 3.9x 2.4x 2892 / 2996 2109 / 2336 1196 / 1516
c-foundationstereo-s – 3873.86 3646.43 1362.1 2.8x 2.7x 8338 / 12870 6312 / 6590 3107 / 4376
fast-foundationstereo (max_disp 192, valid_iters 8) 741.0 527.2 329.98 134.98 3.9x 2.4x 2939 / 3306 2109 / 2256 1196 / 1576

Startup and first call

model load (s): original portable kernels first call (s): original portable kernels
c-fast-foundationstereo (max_disp 192, valid_iters 8) 0.17 (375x1242) 0.24 0.16† 0.17 (375x1242) 0.33† 0.14†
c-foundationstereo-s 1.13 (375x1242) 0.62 0.40† 2.69 (375x1242) 3.65† 1.36†
fast-foundationstereo (max_disp 192, valid_iters 8) 0.16 (375x1242) 0.25 0.14† 0.14 (375x1242) 0.33† 0.14†

Fixed-size speed and peak memory, all models

model mode 640x480 1280x720 1920x1080 12 MP 4000x3000
c-fast-foundationstereo (max_disp 192, valid_iters 8) portable 64.6 ms / 600 / 784 193.1 ms / 1626 / 2144 464.9 ms / 3485 / 4540 OOM
c-fast-foundationstereo (max_disp 192, valid_iters 8) kernels 38.5 ms / 306 / 386 85.9 ms / 762 / 960 182.0 ms / 1582 / 2060 1072.8 ms / 8699 / 11372
c-foundationstereo-s portable 681.8 ms / 2075 / 3130 2218.0 ms (n=3) / 4355 / 6278 4704.5 ms (n=3) / 8457 / 12000 SKIPPED
c-foundationstereo-s kernels 291.3 ms / 1262 / 1430 838.6 ms / 2380 / 3312 1826.4 ms / 4137 / 6164 SKIPPED
fast-foundationstereo (max_disp 192, valid_iters 8) portable 64.6 ms / 600 / 784 193.1 ms / 1626 / 2144 464.8 ms / 3485 / 4540 OOM
fast-foundationstereo (max_disp 192, valid_iters 8) kernels 38.7 ms / 306 / 386 85.8 ms / 762 / 960 181.9 ms / 1582 / 2060 1073.0 ms / 8699 / 11372

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
c-foundationstereo-s ETH3D two-view train, bad > 1 px % / EPE 1.25 / 0.201 1.24 / 0.202
c-foundationstereo-s Middlebury 2014 trainingH, bad > 2 px % / EPE 3.86 / 0.747 3.90 / 0.749
c-fast-foundationstereo ETH3D two-view train, bad > 1 px % / EPE 2.21 / 0.254 2.21 / 0.255
c-fast-foundationstereo Middlebury 2014 trainingH, bad > 2 px % / EPE 7.81 / 1.857 7.83 / 1.859

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.02 px and p99 <= 0.25 px.

Limitations

  • ONNX export needs torch >= 2.14 (older exporters fail on this network).

Usage

from fastforks import stereo

model = stereo.load("c-fast-foundationstereo")  # portable PyTorch on the GPU if there is one, else the CPU
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: c-fast-foundationstereo, c-foundationstereo-s, fast-foundationstereo.

Kernels backend

stereo.load("c-fast-foundationstereo", mode="kernels") runs our CUDA kernels (igev, cutlass_conv, cudnn_hacc, fastbb, fs, fs_cutlass, cfs, ffs_cutlass). 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.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support