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.
- 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.
- portable
Plain PyTorch
A clean port with one API. Validated on CPU, NVIDIA CUDA and Apple MPS, so it runs wherever PyTorch runs.
- 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.
las2-s3.0× vs originallas2-m2.9× vs originalhitnet-eth3d7.9× vs originalcoex-sceneflow2.6× vs originallas2-l3.0× vs originalfast-acvnet-generalization1.6× vs originalfast-acvnet-kitti121.6× vs originalfast-acvnet-kitti151.6× vs original
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 →Tasks
Eight tasks, one calling convention.
Load by id, call on an image path, array or tensor, get a typed result. Licences, accuracy and memory are on every model page.
- 71
Stereo matching
stereo.load(…) → model(left, right)disparity
hitnet-middlebury-d400 · hitnet-eth3d · crestereo-eth3d
- 18
Monocular depth
depth.load(…) → model(image)depth or inverse depth
da3-large-1.1 · depth-anything-v2-s · depth-anything-v2-b
- 5
Multi-view depth
multiview.load(…) → model(images)depth, points and cameras per view
patchmatchnet · mvsanywhere · mapanything-apache
- 8
Promptable segmentation
promptable_segmentation.load(…) → model(image, input_points=…)masks + IoU scores (SAM, SAM 2, SAM 3 text prompts)
sam2.1-hiera-tiny · sam2.1-hiera-small · sam-vit-b
- 16
Semantic segmentation
segmentation.load(…) → model(image)label map
segformer-b0-ade20k · hrnet-w48-fcn-ade20k · deeplabv3plus-r101-d8-ade20k
- 14
Object detection
detection.load(…) → model(image)boxes, labels, scores
dfine-n-coco · dfine-s-coco · detr-r101-coco
- 26
Classification
classification.load(…) → model(image)logits, top(k)
efficientvit_b2 · mobilenetv4_conv_medium · fastvit_sa24
- 16
Feature backbones
features.load(…) → model(image)token features, image embedding
dinov3-vits16 · dinov3-vitl16 · dinov2-vits14-reg
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