BridgeDepth (fastforks)

BridgeDepth (Guan et al. 2025): Depth Anything V2 (ViT-L) features combined with NMRF stereo hypotheses; window-attention message passing between mono and stereo embeddings, inference at 1/8 resolution plus a 1/4 refinement.

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/aeolusguan/BridgeDepth at 9a231601e698.

Author weight repos: https://huggingface.co/aeolusguan/BridgeDepth.

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
bridgedepth-rvc-pretrain@1 bridge_rvc_pretrain.pth 4cb8d0395e67 CC-BY-NC-4.0 no
bridgedepth-sf@1 bridge_sf.pth d2cd44b6f749 CC-BY-NC-4.0 no

Licence

Original-code strings, recorded as they are (research-use package; check them before any other use). Code: MIT. Licence files: LICENSE, LICENSE-torchvision.

Training data: Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa).

  • Licence note: The weights embed Depth Anything V2 weights released under CC-BY-NC-4.0, so they are non-commercial even though the code is MIT.

Licence evidence: https://github.com/aeolusguan/BridgeDepth/blob/9a231601e6981d3536fa6a78ebaccebc1edb99a4/README.md#L40

Input size

any H x W >= 16, padded to a multiple of 16 Tested up to (portable, fp16, RTX 5060 Ti 16 GB): bridgedepth-rvc-pretrain 3000x4000 (13.3 GiB peak allocated, 14.2 reserved); bridgedepth-sf 3000x4000 (13.3 GiB peak allocated, 14.2 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
bridgedepth-rvc-pretrain 629 470 444 355 1.3x 1.3x 2903 / 3200 2707 / 2924 2097 / 2322
bridgedepth-sf 616 460 438 350 1.3x 1.3x 2852 / 3144 2656 / 2872 2046 / 2270

Stereo, synthetic, 994x1482

model time (ms): original fp32 original portable kernels kernels speed-up: vs portable peak memory (MiB, allocated / reserved): portable kernels
bridgedepth-rvc-pretrain – – 444 355 1.2x 2836 / 3144 2226 / 2522

Startup and first call

model load (s): original portable kernels first call (s): original portable kernels
bridgedepth-rvc-pretrain 5.87 (375x1242) 1.17 1.12 1.36 (375x1242) 1.06 1.04
bridgedepth-sf 4.86 (375x1242) 0.97 1.00 0.12 (375x1242) 0.84 0.82

torch.compile and TensorRT

model input time: portable compile TensorRT (fp16 unless shown) kernels preparation: compile (cold first call) ONNX + engine build peak MiB (alloc / reserved): portable compile kernels TensorRT (engine + torch)
bridgedepth-rvc-pretrain 994x1482 444 ms 337 ms public API unavailable 355 ms 118 s – 2707 / 2924 2329 / 2360 2097 / 2322 –
bridgedepth-rvc-pretrain 375x1242 114 ms – 284 ms, fp32 engine (DINOv2 and DPT monocular branch with eager stereo inference) 94.7 ms – 50.0 s 1910 / 2006 – 1323 / 1446 2410 / 2588
bridgedepth-sf 994x1482 438 ms 325 ms public API unavailable 350 ms 111 s – 2656 / 2872 2280 / 2308 2046 / 2270 –
bridgedepth-sf 375x1242 111 ms – 284 ms, fp32 engine (DINOv2 and DPT monocular branch with eager stereo inference) 92.1 ms – 54.1 s 1859 / 1954 – 1272 / 1394 2358 / 2508

Fixed-size speed and peak memory, all models

model mode 480x640 720x1280 1080x1920 12 MP 3000x4000
bridgedepth-rvc-pretrain portable 76.7 ms / 1727 / 1798 247.2 ms / 2359 / 2628 676.5 ms / 3562 / 4102 7918.7 ms (n=3) / 13620 / 14590
bridgedepth-rvc-pretrain kernels 62.2 ms / 1147 / 1266 200.9 ms / 1764 / 2096 534.7 ms / 2939 / 3514 5573.1 ms (n=3) / 12950 / 13592
bridgedepth-sf portable 73.2 ms / 1676 / 1748 242.8 ms / 2308 / 2560 668.4 ms / 3511 / 4032 7849.6 ms (n=3) / 13569 / 14540
bridgedepth-sf kernels 59.1 ms / 1096 / 1214 196.3 ms / 1714 / 2044 526.9 ms / 2888 / 3462 5498.6 ms (n=3) / 12898 / 13540

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 original code named above 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

Use all 15 trainingH pairs with a shared centre crop and edge padding. Score valid non-occluded pixels and exclude right-image correspondences outside the crop. Average the per-pair endpoint error and share of pixels with error above 2 pixels. Original = the original code named under Details, same checkpoint and protocol.

variant dataset original fp32 original fp16 original half portable portable fp32 kernels TensorRT note
bridgedepth-sf ETH3D two-view train, bad > 1 px % / EPE 1.25 / 0.230 1.25 / 0.229 fails (RuntimeError: invalid dtype for bias - should match query's dtype) 1.24 / 0.229 1.25 / 0.230 1.24 / 0.229
bridgedepth-sf Middlebury 2014 trainingH, bad > 2 px % / EPE 9.97 / 2.111 9.99 / 2.109 fails (RuntimeError: invalid dtype for bias - should match query's dtype) 10.00 / 2.111 9.97 / 2.112 10.00 / 2.109
bridgedepth-sf Middlebury 2014 trainingH, fixed 375 x 1242, bad > 2 px % / EPE 6.46 / 1.774 6.46 / 1.774
bridgedepth-rvc-pretrain ETH3D two-view train, bad > 1 px % / EPE 1.22 / 0.191 1.22 / 0.192 fails (RuntimeError: invalid dtype for bias - should match query's dtype) 1.22 / 0.191 1.22 / 0.191 1.22 / 0.191 possibly in the training data
bridgedepth-rvc-pretrain Middlebury 2014 trainingH, bad > 2 px % / EPE 6.35 / 0.950 6.35 / 0.948 fails (RuntimeError: invalid dtype for bias - should match query's dtype) 6.38 / 0.953 6.35 / 0.950 6.37 / 0.952 possibly in the training data
bridgedepth-rvc-pretrain Middlebury 2014 trainingH, fixed 375 x 1242, bad > 2 px % / EPE 3.40 / 0.889 3.40 / 0.889 possibly in the training data

Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 468fba10, 2026-11-05; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 468fba10 / 938a6cc7, 2026-11-05 to 2026-11-19; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 468fba10, 2026-11-05; tensorrt: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 938a6cc7, 2026-11-19.

Parity with the original code

Every variant is checked against reference 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 Runtime resolves top-k ties differently from PyTorch on noise pairs: bridgedepth-sf differs by up to 0.010 px (mean 0.001) on a synthetic textured pair.
  • At fixed 375 x 1242, the FP32 standalone monocular TensorRT branch took 284 ms on both checkpoints versus 324 to 325 ms for paired portable FP32. The stereo branch stayed in PyTorch. The largest individual NOC endpoint-error change was 0.0023 px across the two 15-pair Middlebury checks.

Usage

from fastforks import stereo

# non-commercial weights: run with FASTFORKS_NONCOMMERCIAL=1 in the environment
model = stereo.load("bridgedepth-rvc-pretrain")  # mode="auto": the preferred backend from recorded measurements
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: bridgedepth-rvc-pretrain, bridgedepth-sf.

Kernels backend

stereo.load("bridgedepth-rvc-pretrain", mode="kernels") runs our CUDA kernels (fastbb). 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

Collection including fastforks/bridgedepth