ReCoVEr (fastforks)
ReCoVEr (Kiefhaber, Roth & Schaub-Meyer, ICCV 2025): optical flow without a cost volume. SEA-RAFT's update block refines a flow regressed from a context encoder on both frames (6 channels, stride 8); the authors' training removes the correlation input, so no feature encoder and no correlation pyramid run at inference. 4 iterations, convex upsampling. The authors' released weights; the network is ported from visinf/ReCoVEr. Three context encoders: recover-cx (ConvNeXt-T stages, most accurate), recover-rn (ResNet34 stages), recover-mn (MobileNetV3-Large, fastest). Paper: CX reaches state-of-the-art accuracy at 1.2x the speed and 1/6 the memory of comparable models; MN runs Full HD at 20 FPS in 500 MB.
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/visinf/ReCoVEr at 503a27e38bad.
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 |
|---|---|---|---|---|
recover-cx@1 |
recover_cx.pth | 623319aa23ad |
BSD-3-Clause | yes |
recover-mn@1 |
recover_mn.pth | b187dc6f4de8 |
BSD-3-Clause | yes |
recover-rn@1 |
recover_rn.pth | 3c24e9c62f31 |
BSD-3-Clause | 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.
Training data: TartanAir, FlyingChairs (Freiburg), Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa), MPI Sintel optical flow, KITTI stereo / optical flow 2012 / 2015, HCI HD1K optical flow benchmark (TartanAir, FlyingChairs, FlyingThings3D (part of SceneFlow), then a mix of FlyingThings3D, Sintel, KITTI 2015 and HD1K (TSKH), as upstream's config/recover_*/Tartan*.json stages).
Licence evidence: https://github.com/visinf/ReCoVEr/blob/503a27e38bad1080bd29da91df74c5523e11f8d8/LICENSE
Input size
any H x W >= 64, padded to a multiple of 8
Tested up to (portable, fp16, RTX 5060 Ti 16 GB): recover-cx 1080x1920 (0.7 GiB peak allocated, 0.9 reserved); recover-mn 1080x1920 (0.6 GiB peak allocated, 0.7 reserved); recover-rn 1080x1920 (0.6 GiB peak allocated, 0.7 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 |
|---|---|---|---|---|---|---|---|---|---|---|
recover-cx |
1080x1920 | β | 179 | 107 | 89.8 | 2.0x | 1.2x | 1066 / 1168 | 733 / 892 | 733 / 892 |
recover-mn |
1080x1920 | β | 103 | 45.5 | 41.8 | 2.5x | 1.1x | 921 / 1036 | 580 / 676 | 580 / 676 |
recover-rn |
1080x1920 | β | 130 | 64.1 | 51.3 | 2.5x | 1.2x | 950 / 1046 | 590 / 672 | 590 / 672 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
recover-cx |
3.28 | 0.19 (375x1242) | 0.47 (375x1242) | 0.74 | 0.46 (375x1242) | 0.35 (375x1242) |
recover-mn |
2.03 | 0.26 (375x1242) | 0.48 (375x1242) | 0.53 | 1.08 (375x1242) | 1.05 (375x1242) |
recover-rn |
2.44 | 0.18 (375x1242) | 0.60 (375x1242) | 0.51 | 0.49 (375x1242) | 0.36 (375x1242) |
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) |
|---|---|---|---|---|---|---|---|---|---|---|---|
recover-cx |
1080x1920 | 107 ms | 89.9 ms | 47.5 ms | 89.8 ms | 13.9 s | 41.6 s | 733 / 892 | 504 / 572 | 733 / 892 | 603 / 632 |
recover-mn |
1080x1920 | 45.5 ms | 32.2 ms | 21.2 ms | 41.8 ms | 14.4 s | 56.9 s | 580 / 676 | 365 / 416 | 580 / 676 | 425 / 466 |
recover-rn |
1080x1920 | 64.1 ms | 48.8 ms | 28.9 ms | 51.3 ms | 9.34 s | 34.1 s | 590 / 672 | 375 / 432 | 590 / 672 | 419 / 466 |
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 | kernels | note |
|---|---|---|---|---|---|---|
recover-cx |
KITTI 2015 train, EPE / Fl-all % | 1.044 / 2.86 | 1.045 / 2.86 | 1.044 / 2.86 | 1.043 / 2.85 | trained on this dataset's public images; not a zero-shot result |
recover-rn |
KITTI 2015 train, EPE / Fl-all % | 1.292 / 4.50 | 1.292 / 4.50 | 1.292 / 4.50 | 1.292 / 4.50 | trained on this dataset's public images; not a zero-shot result |
recover-mn |
KITTI 2015 train, EPE / Fl-all % | 1.676 / 7.15 | 1.675 / 7.13 | 1.680 / 7.16 | 1.681 / 7.16 | trained on this dataset's public images; not a zero-shot result |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks e1e54078, 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.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.008 and p99 <= 0.03 (absolute error of the output flow).
Usage
from fastforks import flow
model = flow.load("recover-cx") # 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: recover-cx, recover-mn, recover-rn.
Kernels backend
flow.load("recover-cx", mode="kernels") runs our CUDA kernels (cudnn_hacc). 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.