WAFT (fastforks)

WAFT (Wang & Deng 2025), version a1: optical flow without a cost volume. A frozen Depth Anything V2 Small and a ResNet18 encoder give half-resolution features; each of 5 iterations warps the second image's features by the current flow and a small ViT-S (patch 8) refines the flow, which is convex-upsampled to full resolution. The authors' released weights; the network is ported from princeton-vl/WAFT. waft-a1 is the general checkpoint the authors recommend for downstream use (TartanAir, FlyingChairs, FlyingThings3D); -kitti and -sintel are their benchmark fine-tunes.

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/princeton-vl/WAFT at b152ff1cad1a.

Task: flow. Tier: experimental. Outputs: flow. Backends: portable, kernels.

Input: two RGB images (consecutive frames). Output: per-pixel motion from the first to the second (dx, dy in pixels).

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
waft-a1@1 waft-a1-tar-c-t.pth 9f4b24f48b39 BSD-3-Clause (assumed from code) yes
waft-a1-kitti@1 waft-a1-tar-c-t-kitti.pth b600f7821a52 BSD-3-Clause (assumed from code) yes
waft-a1-sintel@1 waft-a1-tar-c-t-sintel.pth e3d95a6df6ec BSD-3-Clause (assumed from code) yes

Licence

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

Code licence: BSD-3-Clause; the authors do not state a separate weights licence.

Training data: TartanAir, FlyingChairs (Freiburg), Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa) (TartanAir pretraining, FlyingChairs, then FlyingThings3D (part of SceneFlow), as the checkpoint name tar-c-t says; the Depth Anything V2 Small inside was trained by its authors on synthetic and pseudo-labelled real images).

Licence evidence: https://github.com/princeton-vl/WAFT/blob/b152ff1cad1af8c185ee7b141997c48ff3334c87/README.md#model-zoo

Input size

any H x W >= 112, resized or padded inside the model Tested up to (portable, fp16, RTX 5060 Ti 16 GB): waft-a1 1080x1920 (3.5 GiB peak allocated, 4.0 reserved); waft-a1-kitti 1080x1920 (3.5 GiB peak allocated, 4.1 reserved); waft-a1-sintel 1080x1920 (3.5 GiB peak allocated, 4.0 reserved)

Speed and memory

Flow, synthetic

model input time (ms): original fp32 original portable kernels kernels speed-up: vs original vs portable peak memory (MiB, allocated / reserved): original portable kernels
waft-a1 1080x1920 – 1533 791 519 3.0x 1.5x 5537 / 5916 3553 / 4076 1851 / 2264
waft-a1-kitti 1080x1920 – 1533 791 – – – 5537 / 5936 3553 / 4196 –
waft-a1-sintel 1080x1920 – 1533 791 – – – 5537 / 5916 3553 / 4076 –

Startup and first call

model load (s): original portable kernels first call (s): original portable kernels
waft-a1 5.87 0.51 0.57 (375x1242) 3.41 0.79 0.21 (375x1242)
waft-a1-kitti 4.06 0.54 – 2.87 0.79 –
waft-a1-sintel 2.93 0.51 – 2.87 0.79 –

torch.compile and TensorRT

model input time: portable compile TensorRT fp16 kernels preparation: compile (cold first call) ONNX + engine build peak MiB (alloc / reserved): portable compile kernels TensorRT (engine + torch)
waft-a1 1080x1920 791 ms 610 ms deferred (build >5 min) 519 ms 84.7 s – 3553 / 4076 3479 / 3638 1851 / 2264 –
waft-a1-kitti 1080x1920 791 ms 610 ms deferred (build >5 min) – 84.1 s – 3553 / 4196 3479 / 3758 – –
waft-a1-sintel 1080x1920 791 ms 610 ms deferred (build >5 min) – 84.7 s – 3553 / 4076 3479 / 3578 – –

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

Frames _10 -> _11 at full size against the flow_occ ground truth; EPE = mean of the per-pair mean end-point error, Fl-all = share of all valid pixels with an error > 3 px and > 5 % of the GT magnitude. Original = the original code named under Details, same checkpoint and protocol.

variant dataset original fp32 original fp16 portable note
waft-a1 KITTI 2015 train, EPE / Fl-all % 2.395 / 8.52 2.375 / 8.52 2.315 / 8.51

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

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.005 and p99 <= 0.02 (absolute error of the output flow).

Usage

from fastforks import flow

model = flow.load("waft-a1")  # mode="auto": the preferred backend from recorded measurements
result = model("frame1.png", "frame2.png")
result.flow  # [2, H, W] float32 tensor: dx, dy in input pixels
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: waft-a1, waft-a1-kitti, waft-a1-sintel.

Kernels backend

flow.load("waft-a1", mode="kernels") runs our CUDA kernels (igev, cutlass_conv, cudnn_hacc, fastbb, dpt_fused). 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/waft