Open source · Python · PyTorch

Published vision models.
Same output, faster.

Load a stereo, depth, segmentation, detection or feature model by its id and get the original network's output, faster. Each model is ported to plain PyTorch and checked against the authors' code, then sped up with our own CUDA and Metal kernels.

pip install fastforks
from fastforks import stereo, depth

model = stereo.load("igev-stereo-sceneflow")
result = model("left.png", "right.png")
result.disparity  # [H, W] float32 tensor, pixels
result.backend    # kernels on CUDA / Apple silicon, else portable

depth.load("depth-anything-v2-s")("room.jpg").inverse_depth
models
174
tasks
8
median vs original
3.2×
best vs original
9.7×
commercially usable
142

Speed-ups: our kernels against the authors' code with the same checkpoint, at each task's standard input, for the 173 models where the original was timed; RTX 5060 Ti 16 GB.

How it works

One network, two backends.

Nothing is retrained or approximated. fastforks runs the authors' checkpoint, and every speed and accuracy number is measured against their original code.

  1. original

    The authors' code

    The reference: their repository at a pinned commit with the same checkpoint. Used to check parity and to time the baseline.

  2. portable

    Plain PyTorch

    A clean port with one API. Validated on CPU, NVIDIA CUDA and Apple MPS, so it runs wherever PyTorch runs.

  3. kernels

    Our CUDA & Metal kernels

    The same network with fused kernels: NVIDIA sm_80+ on Linux, and Metal on Apple silicon for most families.

mode="auto" picks kernels where they can run and the measurements prefer them, portable everywhere else. mode="kernels" raises with the reason instead of silently falling back.

Speed

Measured, not promised.

Every row is a median of warm runs, with the accuracy checked on public benchmarks. The RTX 5060 Ti 16 GB is the reference and times all three modes; the other devices are surveys of portable against kernels, the Apple M1 Pro across every task. Run fastforks bench MODEL to time both backends on yours.

71 models · input 994x1482 · fastest 8
  1. las2-s 3.0× vs original
    original
    43.5 ms
    portable
    46.9 ms
    kernels
    14.3 ms
  2. las2-m 2.9× vs original
    original
    52.4 ms
    portable
    54.1 ms
    kernels
    18.3 ms
  3. hitnet-eth3d 7.9× vs original
    original
    182 ms
    portable
    67.8 ms
    kernels
    23.2 ms
  4. coex-sceneflow 2.6× vs original
    original
    60.0 ms
    portable
    49.9 ms
    kernels
    23.5 ms
  5. las2-l 3.0× vs original
    original
    90.8 ms
    portable
    80.3 ms
    kernels
    29.9 ms
  6. fast-acvnet-generalization 1.6× vs original
    original
    60.6 ms
    portable
    54.7 ms
    kernels
    38.2 ms
  7. fast-acvnet-kitti12 1.6× vs original
    original
    60.6 ms
    portable
    54.7 ms
    kernels
    38.2 ms
  8. fast-acvnet-kitti15 1.6× vs original
    original
    60.6 ms
    portable
    54.7 ms
    kernels
    38.2 ms

RTX 5060 Ti 16 GB (Blackwell, sm_120) · median of warm runs · the regression floor of every release

All 71 stereo matching models in the table →

Licences

Know what you can ship.

Many vision models are non-commercial. Each fastforks model lists its code licence, weights licence and training data, and is flagged commercial yes only if both licences allow it. Non-commercial weights are never downloaded unless you opt in.

pip install fastforks-core installs only models with permissive code. None of this is legal advice.

import fastforks
from fastforks import stereo

# stereo models whose code and weights allow commercial use
stereo.list_models(commercial="yes")

# licences, and what blocks a "yes"
print(fastforks.describe_models(stereo.list_models("igev*")))

Install

Uses the PyTorch you have.

Install PyTorch for your platform first; fastforks uses that build, CUDA or CPU-only. Weights and kernels download on first use and are checked against a recorded SHA-256.

  • Python 3.11+ · PyTorch 2.8+
  • CUDA kernels Linux x86-64 · NVIDIA compute capability 8.0+ (RTX 30, A100 and newer) · driver 570+
  • Metal kernels Apple silicon
  • Portable anywhere PyTorch runs: CPU, CUDA, MPS
pip install fastforks

Everything: all models plus timm, torchvision, transformers and ONNX.

pip install fastforks-core

Lean: models with permissive code, no extra libraries.

# offline machines: fetch ahead of time
fastforks download depth-anything-v2-s --kernels
# which models can run here, and why not
fastforks doctor