Skip to content

pitin-ev/lightbridge-oss

Repository files navigation

BridgeDepth-light

Lightweight BridgeDepth for stereo disparity estimation, with training and inference scripts for PyTorch.

Highlights

  • 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

Benchmark Results and Model Complexity

The following benchmark results are reported in the attached LightBridge paper (Table 1), comparing LightBridge against lightweight and large-scale stereo matching methods.

Benchmark Table (Table 1)

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 / MACs / Runtime

  • 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

Efficiency Notes

  • 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.

Repository Layout

  • main.py: training / evaluation entrypoint
  • configs/train_mixture_test_all_lightest.yaml: main training config
  • infer.py: simple stereo pair inference
  • demo.py: visualization + optional point cloud and TensorRT inference
  • scripts/train.sh: helper training launcher
  • scripts/make_dataset_sim_link.sh: dataset symlink helper

Docker Setup

1) Build image

docker build -t bridgedepth:latest .

2) Run container

docker run --gpus all --rm -it \
  --ipc=host \
  --shm-size=16g \
  -v $(pwd):/app \
  -v /path/to/raw_datasets:/data/datasets \
  bridgedepth:latest

Inside the container, all commands below assume the working directory is /app.

Dataset Preparation

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/datasets

If a source dataset folder is missing, the script will skip it and print a warning.

Training

Default training command

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.sh

Multi-GPU training example

NUM_GPUS=4 CHECKPOINT_DIR=checkpoints/mixture_test_all_lightest bash scripts/train.sh

Override config options from CLI

bash scripts/train.sh SOLVER.IMS_PER_BATCH 16 DATALOADER.NUM_WORKERS 8

Initialize from a pretrained .pth

FROM_PRETRAINED=checkpoints/pretrained/weights.pth \
NUM_GPUS=4 \
CHECKPOINT_DIR=checkpoints/mixture_test_all_ligtest_finetune \
bash scripts/train.sh

Released Pretrained Model

Use the following files:

  • checkpoints/pretrained/config.yaml
  • checkpoints/pretrained/weights.pth

Note: checkpoints/ is git-ignored in this repository. Distribute large model files separately and place them at the paths above.

Evaluation

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_logs

Inference

Minimal inference

python infer.py \
  --from-pretrained checkpoints/pretrained/weights.pth \
  --input assets/left1.png assets/right1.png \
  --output outputs/infer

For point cloud export, add --get_pc 1 --intrinsic_file assets/K.txt.

License

This project is released under the license in LICENSE.

Acknowledgement

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).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages