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: experimental. 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. 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 442 354 1.3x 1.2x 2903 / 3200 2968 / 3246 2361 / 2686
bridgedepth-sf 616 460 437 348 1.3x 1.3x 2852 / 3144 2916 / 3214 2310 / 2634

Startup and first call

model load (s): original portable kernels first call (s): original portable kernels
bridgedepth-rvc-pretrain 5.87 (375x1242) 1.84 0.76† 1.36 (375x1242) 0.45† 0.36†
bridgedepth-sf 4.86 (375x1242) 1.53 0.72† 0.12 (375x1242) 0.44† 0.35†

torch.compile and TensorRT

model input portable ms compile ms compile s (cold) TensorRT fp16 ms ONNX + build s kernels ms peak MiB (alloc / reserved): portable compile TensorRT (device)
bridgedepth-sf 994x1482 437 325.1 111.4 fails: TensorRT bug: Myelin internal error – 348 2916 / 3214 2280 / 2308 –

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

Apple silicon (MPS)

model portable kernels speed-up
bridgedepth-sf 1065 ms / 4145 MiB (float32) 1012 ms / 4093 MiB 1.05x

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 original fp32 original fp16 portable kernels note
bridgedepth-sf ETH3D two-view train, bad > 1 px % / EPE 1.25 / 0.230 1.25 / 0.229 1.24 / 0.229 1.24 / 0.229
bridgedepth-sf Middlebury 2014 trainingH, bad > 2 px % / EPE 9.97 / 2.111 9.99 / 2.109 10.00 / 2.111 10.00 / 2.109
bridgedepth-rvc-pretrain ETH3D two-view train, bad > 1 px % / EPE 1.22 / 0.191 1.22 / 0.192 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 6.38 / 0.953 6.37 / 0.952 possibly in the training data

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-05.

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.

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