fastforks
Open-source Python library that provides faster ports of pretrained computer vision models behind one API, with optional CUDA and Metal kernels.
At a Glance
fastforks core, wrappers and CUDA/Metal kernels are Apache-2.0 licensed and free to install via pip. Vendored model code and some model weights keep their original licences, and some are non-commercial.
Engagement
Available On
Listed Dec 2026
About fastforks
fastforks is an open-source Python and PyTorch library by Florian Nick that wraps pretrained vision models behind a single load-by-id API. You load a stereo, depth, segmentation, detection or feature model and get the original network's output, run in fp16 and close to but not bit-identical with the authors' code. The project lists 622 models from 217 families across 20 tasks.
What It Is
fastforks ports published vision models to plain PyTorch and checks them against the authors' code and checkpoints. Nothing is retrained. Each task has its own module, such as stereo, depth, segmentation, detection, matting, OCR, pose, optical flow, point tracking and 3D volume segmentation. You call the loaded model on an image path, array or tensor and receive a typed result, for example a disparity tensor or a label map.
Portable and kernel backends
Every model has a portable backend in plain PyTorch, validated on CPU, NVIDIA CUDA and Apple MPS. The kernels backend uses custom CUDA kernels (NVIDIA compute capability 8.0+, Linux or Windows x86-64) and Metal kernels on Apple silicon for some families. The default mode picks kernels where they can run and measurements prefer them; forcing kernels mode raises an error with the reason instead of silently falling back. The project reports a median speed-up of 3.2x over the authors' code at 16-bit precision, measured on an RTX 5060 Ti.
Pipelines, CLI and ComfyUI
Beyond single models, it offers pipelines such as structure from motion producing COLMAP databases and reconstructions, calibrated stereo with rectification, and two-view pose with RANSAC. A command line lists and describes models, downloads weights, benchmarks both backends, exports to ONNX or TensorRT, and diagnoses what can run locally. A ComfyUI node pack exposes one node per task with automatic weight download.
Licences and install
Each model page lists code licence, weights licence and training data, and flags a model commercial only if both allow it. Non-commercial weights are not downloaded unless the user opts in. The fastforks package installs all models, while fastforks-core installs only models with permissive code. It requires Python 3.11+ and PyTorch 2.8+. The core code is Apache-2.0, and vendored model code keeps its original licence.
Collections
Popular collections
- Code Knowledge Graphs
Collection by @evtuff
- Obsidian Agentic & AI plugins
Collection by @samofcode
- Codebase Context Generators
Collection by @joemseifi
- Frameworks
Collection by @joemseifi
Add fastforks to one of your collections.
Community Discussions
Be the first to start a conversation about fastforks
Share your experience with fastforks, ask questions, or help others learn from your insights.
Pricing
Open Source (Apache-2.0)
fastforks core, wrappers and CUDA/Metal kernels are Apache-2.0 licensed and free to install via pip. Vendored model code and some model weights keep their original licences, and some are non-commercial.
- Install with pip install fastforks or pip install fastforks-core
- Core, wrappers and kernels under Apache-2.0
- Vendored model code keeps its original licence
- Non-commercial weights are not downloaded unless you opt in
- 549 of 622 models flagged commercially usable
Capabilities
Key Features
- Load pretrained vision models by id through one API
- 622 models across 20 tasks
- Portable PyTorch backend validated on CPU, CUDA and Apple MPS
- Custom CUDA and Metal kernels for faster inference
- Automatic backend selection with forced mode option
- Per-model licence and commercial-use flags
- Structure from motion, stereo geometry and pose pipelines
- ONNX and TensorRT export
- CLI for listing, downloading, benchmarking and diagnosing models
- ComfyUI node pack
- SHA-256 checked weight downloads
- Apple MLX port for many models
