How nvlabs/fast-foundationstereo works
Fast-FoundationStereo is a zero-shot stereo-matching product that estimates disparity from rectified left/right images and can derive metric depth and a point cloud using camera intrinsics and baseline. The primary workflow is the Python demo loading a checkpoint, running the PyTorch model, and producing visualizations and optional point-cloud output. The repository also documents TensorRT deployment, including a single-engine route and C++ inference. Model internals and C++ deployment responsibilities are grounded in sampled source and the SOURCE INDEX; broader workflow links use README documentation, so unsampled implementation details are not inferred.
Main entry points: run_demo.py Python demo · foundation_stereo.py Stereo matcher · main.cpp C++ inference app · extractor.py Feature encoder
Components 22
Python inference
- Python demo
scripts/run_demo.py - Model checkpoint
weights - Inference helpers
core/utils/utils.py
Stereo model
- Stereo matcher
core/foundation_stereo.py - Feature encoder
core/extractor.py - Neural blocks
core/submodule.py - Cost volume
core/foundation_stereo.py - Disparity refinement
core/update.py - Stereo geometry
core/geometry.py
TensorRT deployment
- TensorRT demos
scripts/run_demo_tensorrt.py - Single-engine demo
scripts/run_demo_single_trt.py - Plugin demo
scripts/run_demo_plugin_trt.py - C++ inference app
cpp/app/main.cpp - Split-engine backend
cpp/src/ffs_depth_tensorrt.cpp - Single-engine backend
cpp/src/ffs_depth_single_tensorrt.cpp - GWC TensorRT plugin
cpp/src/gwc_volume_plugin.cpp
Depth products
- Depth and point cloud
Utils.py - Disparity and depth
cpp/app/main.cpp - Point cloud
scripts/run_demo.py
Other components
- Application user
- Stereo images
- Camera parameters
Connections 24
- Application user → Python demo: runs
readme.md - Stereo images → Python demo: provides images
readme.md - Camera parameters → Python demo: provides intrinsics
readme.md - Model checkpoint → Python demo: loads weights
readme.md - Python demo → Stereo matcher: invokes
scripts/run_demo.py - Python demo → Inference helpers: uses helpers
scripts/run_demo.py - Python demo → Depth and point cloud: derives products
readme.md - Python demo → Disparity and depth: writes results
readme.md - Python demo → Point cloud: optionally writes
readme.md - Stereo matcher → Feature encoder: extracts features
core/foundation_stereo.py - Feature encoder → Neural blocks: uses blocks
core/extractor.py - Stereo matcher → Cost volume: builds correlation
core/foundation_stereo.py - Stereo matcher → Disparity refinement: updates disparity
core/foundation_stereo.py - Stereo matcher → Stereo geometry: uses geometry
core/foundation_stereo.py - Application user → TensorRT demos: runs
readme.md - TensorRT demos → Disparity and depth: produces inference
readme.md - Application user → Single-engine demo: runs
readme.md - Application user → Plugin demo: runs
readme.md - Application user → C++ inference app: runs
cpp/app/main.cpp - C++ inference app → Split-engine backend: invokes backend
cpp/app/main.cpp - C++ inference app → Single-engine backend: invokes backend
cpp/app/main.cpp - Single-engine backend → GWC TensorRT plugin: uses plugin
cpp/src/ffs_depth_single_tensorrt.cpp - C++ inference app → Disparity and depth: writes maps
cpp/app/main.cpp - C++ inference app → Camera parameters: reads intrinsics
cpp/app/main.cpp