card: update from fastforks 1cbf1671
Browse files
README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: "fastforks"
|
| 3 |
+
pipeline_tag: "image-to-image"
|
| 4 |
+
license: "other"
|
| 5 |
+
license_name: "see-model-card"
|
| 6 |
+
license_link: "https://github.com/princeton-vl/WAFT/blob/b152ff1cad1af8c185ee7b141997c48ff3334c87/README.md#model-zoo"
|
| 7 |
+
tags:
|
| 8 |
+
- "flow"
|
| 9 |
+
- "optical-flow"
|
| 10 |
+
- "motion-estimation"
|
| 11 |
+
- "cuda"
|
| 12 |
+
- "pytorch"
|
| 13 |
+
- "fastforks"
|
| 14 |
+
- "fastforks-card"
|
| 15 |
+
---
|
| 16 |
+
# WAFT (fastforks)
|
| 17 |
+
|
| 18 |
+
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.
|
| 19 |
+
|
| 20 |
+
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`.
|
| 21 |
+
|
| 22 |
+
Task: flow. Tier: experimental. Outputs: `flow`. Backends: `portable`, `kernels`.
|
| 23 |
+
|
| 24 |
+
Input: two RGB images (consecutive frames). Output: per-pixel motion from the first to the second (dx, dy in pixels).
|
| 25 |
+
|
| 26 |
+
## Variants
|
| 27 |
+
|
| 28 |
+
Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in [`card.toml`](https://github.com/kleinicke/fastforks/blob/main/src/fastforks/flow/models/waft/card.toml).
|
| 29 |
+
|
| 30 |
+
| variant | weights (author link) | SHA-256 | weights licence | commercial use |
|
| 31 |
+
|---|---|---|---|---|
|
| 32 |
+
| `waft-a1@1` | [waft-a1-tar-c-t.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1CxzBQx0iSg6AyIgt6MF0ROlF_cAeZLPC) | `9f4b24f48b39` | BSD-3-Clause (assumed from code) | yes |
|
| 33 |
+
| `waft-a1-kitti@1` | [waft-a1-tar-c-t-kitti.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1hzpxBe80BmPCXjo9DvSszdCRsio5vLaB) | `b600f7821a52` | BSD-3-Clause (assumed from code) | yes |
|
| 34 |
+
| `waft-a1-sintel@1` | [waft-a1-tar-c-t-sintel.pth](https://drive.usercontent.google.com/download?export=download&confirm=t&id=1pAsbH0Orb5mFo4CLCYi4dSm6FjxrOqO3) | `e3d95a6df6ec` | BSD-3-Clause (assumed from code) | yes |
|
| 35 |
+
|
| 36 |
+
## Licence
|
| 37 |
+
|
| 38 |
+
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: BSD-3-Clause. Licence files: `LICENSE`.
|
| 39 |
+
|
| 40 |
+
Code licence: BSD-3-Clause; the authors do not state a separate weights licence.
|
| 41 |
+
|
| 42 |
+
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).
|
| 43 |
+
|
| 44 |
+
Licence evidence: <https://github.com/princeton-vl/WAFT/blob/b152ff1cad1af8c185ee7b141997c48ff3334c87/README.md#model-zoo>
|
| 45 |
+
|
| 46 |
+
## Input size
|
| 47 |
+
|
| 48 |
+
any H x W >= 112, resized or padded inside the model
|
| 49 |
+
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)
|
| 50 |
+
|
| 51 |
+
## Speed and memory
|
| 52 |
+
|
| 53 |
+
### Flow, synthetic
|
| 54 |
+
|
| 55 |
+
| model | input | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|
| 56 |
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
| 57 |
+
| `waft-a1` | 1080x1920 | β | 1533 | 791 | 519 | 3.0x | 1.5x | 5537 / 5916 | 3553 / 4076 | 1851 / 2264 |
|
| 58 |
+
| `waft-a1-kitti` | 1080x1920 | β | 1533 | 791 | β | β | β | 5537 / 5936 | 3553 / 4196 | β |
|
| 59 |
+
| `waft-a1-sintel` | 1080x1920 | β | 1533 | 791 | β | β | β | 5537 / 5916 | 3553 / 4076 | β |
|
| 60 |
+
|
| 61 |
+
### Startup and first call
|
| 62 |
+
|
| 63 |
+
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|
| 64 |
+
| --- | --- | --- | --- | --- | --- | --- |
|
| 65 |
+
| `waft-a1` | 5.87 | 0.51 | 0.57 (375x1242) | 3.41 | 0.79 | 0.21 (375x1242) |
|
| 66 |
+
| `waft-a1-kitti` | 4.06 | 0.54 | β | 2.87 | 0.79 | β |
|
| 67 |
+
| `waft-a1-sintel` | 2.93 | 0.51 | β | 2.87 | 0.79 | β |
|
| 68 |
+
|
| 69 |
+
### torch.compile and TensorRT
|
| 70 |
+
|
| 71 |
+
| 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) |
|
| 72 |
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
| 73 |
+
| `waft-a1` | 1080x1920 | 791 ms | 610 ms | deferred (build >5 min) | 519 ms | 84.7 s | β | 3553 / 4076 | 3479 / 3638 | 1851 / 2264 | β |
|
| 74 |
+
| `waft-a1-kitti` | 1080x1920 | 791 ms | 610 ms | deferred (build >5 min) | β | 84.1 s | β | 3553 / 4196 | 3479 / 3758 | β | β |
|
| 75 |
+
| `waft-a1-sintel` | 1080x1920 | 791 ms | 610 ms | deferred (build >5 min) | β | 84.7 s | β | 3553 / 4076 | 3479 / 3578 | β | β |
|
| 76 |
+
|
| 77 |
+
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
|
| 78 |
+
|
| 79 |
+
Hardware, protocol and caveats: [benchmarks](https://github.com/kleinicke/fastforks/blob/main/docs/benchmarks.md) (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.
|
| 80 |
+
|
| 81 |
+
## Accuracy
|
| 82 |
+
|
| 83 |
+
### On public datasets
|
| 84 |
+
|
| 85 |
+
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.
|
| 86 |
+
|
| 87 |
+
| variant | dataset | original fp32 | original fp16 | portable | note |
|
| 88 |
+
|---|---|---|---|---|---|
|
| 89 |
+
| `waft-a1` | KITTI 2015 train, EPE / Fl-all % | 2.395 / 8.52 | 2.375 / 8.52 | 2.315 / 8.51 | |
|
| 90 |
+
|
| 91 |
+
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks ec1d48ea, 2026-11-14.
|
| 92 |
+
|
| 93 |
+
### Parity with the original code
|
| 94 |
+
|
| 95 |
+
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`).
|
| 96 |
+
|
| 97 |
+
## Usage
|
| 98 |
+
|
| 99 |
+
```python
|
| 100 |
+
from fastforks import flow
|
| 101 |
+
|
| 102 |
+
model = flow.load("waft-a1") # mode="auto": the preferred backend from recorded measurements
|
| 103 |
+
result = model("frame1.png", "frame2.png")
|
| 104 |
+
result.flow # [2, H, W] float32 tensor: dx, dy in input pixels
|
| 105 |
+
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
Install with `pip install fastforks` (see <https://github.com/kleinicke/fastforks>). Other variants: `waft-a1`, `waft-a1-kitti`, `waft-a1-sintel`.
|
| 109 |
+
|
| 110 |
+
## Kernels backend
|
| 111 |
+
|
| 112 |
+
`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.
|
| 113 |
+
|
| 114 |
+
<!-- staged from fastforks 1cbf1671 (2026-11-15) -->
|