Lightweight BridgeDepth for stereo disparity estimation, with training and inference scripts for PyTorch.
- Lightweight BridgeDepth model implementation in
bridgedepth/ - Multi-dataset training with
configs/train_mixture_test_all_lightest.yaml - Inference scripts for regular PyTorch (
infer.py,demo.py) - Docker-first workflow for reproducibility
The following benchmark results are reported in the attached LightBridge paper (Table 1), comparing LightBridge against lightweight and large-scale stereo matching methods.
| Methods | KITTI12 (D1) | KITTI15 (D1) | ETH3D (BP 1) | Middlebury (BP 2) | MACs (G) |
|---|---|---|---|---|---|
| Lightweight Efficient Methods | |||||
| CoEx | 22.3 | 17.33 | 31.97 | 26.42 | 54 |
| MobileStereoNet-2D | 19.3 | 21.88 | 17.1 | 37.98 | 127 |
| FastACV | 13.9 | 11.83 | 7.84 | 19.61 | 72 |
| Lite-CREStereo++ | 5.93 | 7.37 | 8.95 | 14.91 | 101 |
| LightStereo-M | 6.76 | 6.79 | 13.93 | 16.99 | 33 |
| LightStereo-L | 6.8 | 6.62 | 9.66 | 17.23 | 84 |
| LightBridge (Ours) | 3.6 | 3.8 | 2.5 | 6.93 | 44.6 |
| Large-scale Accurate Methods | |||||
| Selective-IGEV | 3.2 | 4.5 | 3.4 | 7.5 | 3,619 |
| BridgeDepth | 3.6 | 4.5 | 1.3 | 4.3 | 1,081 |
| FoundationStereo | 2.51 | 2.83 | 0.49 | 1.12 | 12,240 |
- Parameters: 4.3M
- MACs: 44.6G (the paper also refers to this as ~45G in the discussion)
- Input resolution for operator count / runtime measurement: 1242 × 375
- Runtime (reported):
- 106 FPS on NVIDIA H100
- 47 FPS on NVIDIA RTX 4060
- LightBridge reduces compute by about 96% compared to the original BridgeDepth (from 1,081G MACs to 44.6G MACs).
- Despite the lightweight design, it maintains strong zero-shot performance across KITTI, ETH3D, and Middlebury benchmarks.
main.py: training / evaluation entrypointconfigs/train_mixture_test_all_lightest.yaml: main training configinfer.py: simple stereo pair inferencedemo.py: visualization + optional point cloud and TensorRT inferencescripts/train.sh: helper training launcherscripts/make_dataset_sim_link.sh: dataset symlink helper
docker build -t bridgedepth:latest .docker run --gpus all --rm -it \
--ipc=host \
--shm-size=16g \
-v $(pwd):/app \
-v /path/to/raw_datasets:/data/datasets \
bridgedepth:latestInside the container, all commands below assume the working directory is /app.
This project expects datasets under /app/datasets with specific names (e.g. SceneFlow, KITTI/KITTI_2012, KITTI/KITTI_2015, etc.).
Use the symlink helper:
bash scripts/make_dataset_sim_link.sh /app /data/datasetsIf a source dataset folder is missing, the script will skip it and print a warning.
scripts/train.sh defaults to:
- config:
configs/train_mixture_test_all_lightest.yaml - output dir:
checkpoints/mixture_test_all_lightest - GPUs:
1
Run:
bash scripts/train.shNUM_GPUS=4 CHECKPOINT_DIR=checkpoints/mixture_test_all_lightest bash scripts/train.shbash scripts/train.sh SOLVER.IMS_PER_BATCH 16 DATALOADER.NUM_WORKERS 8FROM_PRETRAINED=checkpoints/pretrained/weights.pth \
NUM_GPUS=4 \
CHECKPOINT_DIR=checkpoints/mixture_test_all_ligtest_finetune \
bash scripts/train.shUse the following files:
checkpoints/pretrained/config.yamlcheckpoints/pretrained/weights.pth
Note: checkpoints/ is git-ignored in this repository. Distribute large model files separately and place them at the paths above.
Use the saved config and checkpoint:
python main.py \
--eval-only \
--config-file checkpoints/pretrained/config.yaml \
--from-pretrained checkpoints/pretrained/weights.pth \
--checkpoint-dir checkpoints/eval_logspython infer.py \
--from-pretrained checkpoints/pretrained/weights.pth \
--input assets/left1.png assets/right1.png \
--output outputs/inferFor point cloud export, add --get_pc 1 --intrinsic_file assets/K.txt.
This project is released under the license in LICENSE.
This work was supported by Institute of Information & Communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (RS-2025-02653113, High-Performance Research AI Computing Infrastructure Support at the 2 PFLOPS Scale).