SEA-RAFT
SEA-RAFT (Princeton, 2024): a faster and more accurate successor of RAFT for dense optical flow, needing only 4 refinement steps. BSD-3-Clause code and weights; some training sets are research-only.
stable Fork of princeton-vl/SEA-RAFT@9137517 · backends: portable, kernels
- Paper SEA-RAFT: Simple, Efficient, Accurate RAFT for Optical Flow ECCV 2024 · first released 23 May 2024
Paper 2024 Added in 0.2.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import flow
model = flow.load("sea-raft-m") # kernels on a supported GPU, else portable PyTorch
result = model(frame1, frame2)
result.flow
result.backend # what ran: mode, device, dtype, kernels fastforks bench sea-raft-m Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32upstream RAFT (spring-M.json architecture) + evaluate.py calc_flow, iters=4, scale=0 | fp32 | 504 | 0.73× | 8,503 MiB/8,580 MiB | 1.2 | 0.51 |
| Original fp16torch.autocast(fp16) around the call; upstream RAFT (spring-M.json architecture) + evaluate.py calc_flow, iters=4, scale=0 | fp16 | 367 | – | 7,385 MiB/8,570 MiB | 0.5 | 0.37 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 270 | 1.4× | 6,060 MiB/6,180 MiB | 0.3 | 0.27 |
| Kernels | fp16 | 73.4 | 5.0× | 425 MiB/454 MiB | 0.4 | 0.07 |
| Portable + torch.compile | 191 | 1.9× | 5,869 MiB/5,920 MiB | 34 (build) | – | |
| TensorRT fp16 | fp16 | 132 | 2.8× | 10.6 GiBenginenot comparable | 70 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-10 to 2026-11-16. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14 | Original | fp32 | 2637 | 12.2 GiB process | – | 1080x1920 |
| Portable | fp16 | 1635 | 9,732 MiB process | matches | 1080x1920 | |
| Portable | fp32 | 1820 | 12.2 GiB process | matches | 1080x1920 | |
| Kernels | fp16 | 1220 | 4,752 MiB process | matches | 1080x1920 |
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Commercial use allowed
- Code
- BSD-3-Clause LICENSE
- Weights
- BSD-3-Clause source
- Training data
-
- TartanAir CC-BY-4.0
- FlyingChairs (Freiburg) research-only, non-commercial
- Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa) research-only, non-commercial
- MPI Sintel optical flow noncommercial, non-commercial
- KITTI stereo / optical flow 2012 / 2015 CC-BY-NC-SA-3.0, non-commercial
- HCI HD1K optical flow benchmark not stated
Our reading of the licences, not legal advice.
Weights
Tartan-C-T-TSKH432x960-M.safetensors 78.8 MB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download sea-raft-m).
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
KITTI 2015 train
EPE / Fl-all %trained on this dataset’s public images: not zero-shot
| Run | dtype | EPE ↓ | Fl-all % ↓ | Δ EPE vs fp32 original | pairs | ms / pair |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 0.880 | 2.51 | reference | 200 | 86.8 |
| Original fp16 | fp16 | 0.880 | 2.51 | +0.000 | 200 | 50.7 |
| Portable fp32 | fp32 | 0.880 | 2.51 | ±0.000 | 200 | 78.9 |
| Portable | fp16 | 0.880 | 2.51 | +0.000 | 200 | 46.3 |
| Kernels | fp16 | 0.880 | 2.50 | +0.000 | 200 | 20.2 |
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 authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-11; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6f0a70e1, 2026-11-17; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks f2992269+unc, 2026-11-10.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.00025 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.002 and p99 <= 0.014 (absolute error of the output flow).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.00025 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.002 | 0.00103 |
| GPU default dtypes, p99 |diff| | ≤ 0.014 | 0.00459 |
| gpu_mean_kernels | ≤ 0.0041 | not recorded |
| gpu_p99_kernels | ≤ 0.024 | not recorded |
Recorded for sea-raft-m on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-12, with these kernels: cudnn_hacccutlass_convraft_flow
Details
SEA-RAFT (Wang, Lipson & Deng 2024): RAFT with ResNet encoders, an initial flow regressed from the context features and a ConvNeXt update block, so 4 iterations suffice; correlation pyramid at 1/8 resolution, convex upsampling. The authors' released weights (pretrained on TartanAir); the network is ported from princeton-vl/SEA-RAFT. `sea-raft-m` / `sea-raft-s` are the general checkpoints (trained on the FlyingThings3D, Sintel, KITTI and HD1K mix); the `-spring` variants are made for 1080p footage and work at half resolution, as upstream evaluates them: the pair is halved (bilinear), the flow is upsampled and doubled. Paper (zero-shot after FlyingChairs + FlyingThings, the C-T weights): KITTI 2015 train EPE 4.29 / Fl-all 14.2 % (M), Sintel train EPE 1.21 clean / 4.04 final (M); M with 12 iterations (`iters=12`) is the paper's SEA-RAFT (L).
- Input / output
- Input: two RGB images (consecutive frames). Output: per-pixel motion from the first to the second (dx, dy in pixels).
- Input size
- any H x W >= 128, padded to a multiple of 8; tested up to 1024x2048 (8,509 MiB allocated)
- Options
iters=4>= 1· changes the output
- Outputs
flow- CUDA kernels
raft_flowRAFT optical flow kernelscutlass_convCUTLASS convolutions with the recurrent update (GRU) fused incudnn_haccconvolutions with fp16 accumulation (cuDNN)
- Apple (MPS)
flow_metalMetal: RAFT correlation lookup without a volume. fp32, fp16
Full reference, generated from the repository
SEA-RAFT (Princeton, 2024): a faster and more accurate successor of RAFT for dense optical flow, needing only 4 refinement steps. BSD-3-Clause code and weights; some training sets are research-only.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
sea-raft-m | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 504 367 270 73.4 191 132 | 8503 / 8580 7385 / 8570 6060 / 6180 425 / 454 5869 / 5920 11110 / 11130 |
sea-raft-m-kitti | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 504 367 270 73.3 191 132 | 8503 / 8580 7385 / 8570 6060 / 6180 425 / 454 5869 / 5920 11110 / 11130 |
sea-raft-m-spring | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 96.1 56.7 46.8 23.5 34.6 4.43 | 759 / 858 761 / 812 652 / 700 170 / 194 624 / 640 291 / 318 |
sea-raft-m-things | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 504 367 270 73.0 192 132 | 8503 / 8580 7385 / 8570 6060 / 6180 425 / 454 5869 / 5920 11110 / 11130 |
sea-raft-s | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 365 300 211 50.6 150 108 | 8462 / 8554 7323 / 8502 6019 / 6136 404 / 452 5828 / 5876 11043 / 11078 |
sea-raft-s-kitti | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 365 299 210 50.7 150 108 | 8462 / 8554 7323 / 8502 6019 / 6136 404 / 432 5828 / 5876 11043 / 11078 |
sea-raft-s-spring | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 67.1 42.4 32.8 16.2 23.8 3.01 | 718 / 814 699 / 764 611 / 656 150 / 172 582 / 596 215 / 278 |
Details
- Original code: https://github.com/princeton-vl/SEA-RAFT at
9137517ba24e - Code licence: BSD-3-Clause (permissive); files:
LICENSE - Weights licence: BSD-3-Clause
- Licence evidence: https://huggingface.co/MemorySlices/Tartan-C-T-TSKH432x960-M/blob/85a47dc9096cca6e907ef9100dc1847a19b26a2a/README.md
- 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 pretraining, FlyingChairs, FlyingThings3D (part of SceneFlow), then a mix of FlyingThings3D, Sintel, KITTI 2015 and HD1K (TSKH))
sea-raft-m-kitti: 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, the TSKH mix, then fine-tuned on KITTI 2015)sea-raft-m-spring: TartanAir, FlyingChairs (Freiburg), Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa), MPI Sintel optical flow, KITTI stereo / optical flow 2012 / 2015, HCI HD1K optical flow benchmark, Spring (scene flow / optical flow / stereo, University of Stuttgart) (TartanAir, FlyingChairs, FlyingThings3D, the TSKH mix, then fine-tuned on Spring)sea-raft-m-things: TartanAir, FlyingChairs (Freiburg), Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa) (TartanAir, FlyingChairs, then FlyingThings3D (part of SceneFlow))sea-raft-s-kitti: 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, the TSKH mix, then fine-tuned on KITTI 2015)sea-raft-s-spring: TartanAir, FlyingChairs (Freiburg), Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa), MPI Sintel optical flow, KITTI stereo / optical flow 2012 / 2015, HCI HD1K optical flow benchmark, Spring (scene flow / optical flow / stereo, University of Stuttgart) (TartanAir, FlyingChairs, FlyingThings3D, the TSKH mix, then fine-tuned on Spring)
- Options:
iters= 4 (>= 1) - Kernel libraries:
raft_flow,cutlass_conv,cudnn_hacc - Variants:
sea-raft-m,sea-raft-m-kitti,sea-raft-m-spring,sea-raft-m-things,sea-raft-s,sea-raft-s-kitti,sea-raft-s-spring - Outputs: flow
- Input size:
sea-raft-m,sea-raft-m-kitti,sea-raft-m-things,sea-raft-s,sea-raft-s-kitti: any H x W >= 128, padded to a multiple of 8sea-raft-m-spring,sea-raft-s-spring: any H x W >= 256, padded to a multiple of 8
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
sea-raft-m1024x2048 (8.3 GiB peak allocated, 9.4 reserved);sea-raft-m-kitti1024x2048 (8.3 GiB peak allocated, 9.4 reserved);sea-raft-m-spring1988x2880 (4.1 GiB peak allocated, 4.8 reserved);sea-raft-m-things1024x2048 (8.3 GiB peak allocated, 9.4 reserved);sea-raft-s1024x2048 (8.3 GiB peak allocated, 9.3 reserved);sea-raft-s-kitti1024x2048 (8.3 GiB peak allocated, 9.3 reserved);sea-raft-s-spring1988x2880 (4.1 GiB peak allocated, 4.8 reserved) sea-raft-m1080x1920, first call: portable + torch.compile 34 s (cold Inductor cache), TensorRT fp16 70 s (ONNX + engine).sea-raft-m-kitti1080x1920, first call: portable + torch.compile 35 s (cold Inductor cache), TensorRT fp16 70 s (ONNX + engine).sea-raft-m-spring1080x1920, first call: portable + torch.compile 23 s (cold Inductor cache), TensorRT fp16 47 s (ONNX + engine).sea-raft-m-things1080x1920, first call: portable + torch.compile 35 s (cold Inductor cache), TensorRT fp16 74 s (ONNX + engine).sea-raft-s1080x1920, first call: portable + torch.compile 35 s (cold Inductor cache), TensorRT fp16 68 s (ONNX + engine).sea-raft-s-kitti1080x1920, first call: portable + torch.compile 32 s (cold Inductor cache), TensorRT fp16 67 s (ONNX + engine).sea-raft-s-spring1080x1920, first call: portable + torch.compile 22 s (cold Inductor cache), TensorRT fp16 39 s (ONNX + engine).sea-raft-moriginal (fp32) 1080x1920: upstream RAFT (spring-M.json architecture) + evaluate.py calc_flow, iters=4, scale=0sea-raft-moriginal 1080x1920: torch.autocast(fp16) around the call; upstream RAFT (spring-M.json architecture) + evaluate.py calc_flow, iters=4, scale=0sea-raft-m-kittioriginal (fp32) 1080x1920: upstream RAFT (spring-M.json architecture) + evaluate.py calc_flow, iters=4, scale=0sea-raft-m-kittioriginal 1080x1920: torch.autocast(fp16) around the call; upstream RAFT (spring-M.json architecture) + evaluate.py calc_flow, iters=4, scale=0sea-raft-m-springoriginal (fp32) 1080x1920: upstream RAFT (spring-M.json architecture) + evaluate.py calc_flow, iters=4, scale=-1sea-raft-m-springoriginal 1080x1920: torch.autocast(fp16) around the call; upstream RAFT (spring-M.json architecture) + evaluate.py calc_flow, iters=4, scale=-1sea-raft-m-thingsoriginal (fp32) 1080x1920: upstream RAFT (spring-M.json architecture) + evaluate.py calc_flow, iters=4, scale=0sea-raft-m-thingsoriginal 1080x1920: torch.autocast(fp16) around the call; upstream RAFT (spring-M.json architecture) + evaluate.py calc_flow, iters=4, scale=0sea-raft-soriginal (fp32) 1080x1920: upstream RAFT (spring-S.json architecture) + evaluate.py calc_flow, iters=4, scale=0sea-raft-soriginal 1080x1920: torch.autocast(fp16) around the call; upstream RAFT (spring-S.json architecture) + evaluate.py calc_flow, iters=4, scale=0sea-raft-s-kittioriginal (fp32) 1080x1920: upstream RAFT (spring-S.json architecture) + evaluate.py calc_flow, iters=4, scale=0sea-raft-s-kittioriginal 1080x1920: torch.autocast(fp16) around the call; upstream RAFT (spring-S.json architecture) + evaluate.py calc_flow, iters=4, scale=0sea-raft-s-springoriginal (fp32) 1080x1920: upstream RAFT (spring-S.json architecture) + evaluate.py calc_flow, iters=4, scale=-1sea-raft-s-springoriginal 1080x1920: torch.autocast(fp16) around the call; upstream RAFT (spring-S.json architecture) + evaluate.py calc_flow, iters=4, scale=-1sea-raft-mload / first call: original 0.53 s / 0.367 s, portable 0.29 s / 0.27 s, kernels 1.15 s / 0.072 ssea-raft-m-kittiload / first call: original 0.67 s / 0.367 s, portable 1.02 s / 0.27 s, kernels 1.14 s / 0.072 ssea-raft-m-springload / first call: original 0.57 s / 0.06 s, portable 0.74 s / 0.052 s, kernels 1.14 s / 0.023 ssea-raft-m-thingsload / first call: original 0.55 s / 0.367 s, portable 0.29 s / 0.27 s, kernels 1.13 s / 0.072 ssea-raft-sload / first call: original 0.3 s / 0.3 s, portable 0.18 s / 0.211 s, kernels 1.1 s / 0.05 ssea-raft-s-kittiload / first call: original 0.3 s / 0.299 s, portable 0.27 s / 0.211 s, kernels 1.1 s / 0.05 ssea-raft-s-springload / first call: original 0.31 s / 0.043 s, portable 0.34 s / 0.039 s, kernels 1.11 s / 0.016 s- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
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 | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|
sea-raft-m | KITTI 2015 train, EPE / Fl-all % | 0.880 / 2.51 | 0.880 / 2.51 | 0.880 / 2.51 | 0.880 / 2.51 | 0.880 / 2.50 | trained on this dataset's public images; not a zero-shot result |
sea-raft-m-kitti | KITTI 2015 train, EPE / Fl-all % | 0.808 / 2.16 | 0.808 / 2.16 | 0.808 / 2.16 | 0.808 / 2.16 | 0.808 / 2.16 | trained on this dataset's public images; not a zero-shot result |
sea-raft-m-spring | KITTI 2015 train, EPE / Fl-all % | 6.779 / 23.75 | 6.775 / 23.74 | 6.775 / 23.74 | 6.779 / 23.75 | 6.783 / 23.74 | trained on this dataset's public images; not a zero-shot result |
sea-raft-m-things | KITTI 2015 train, EPE / Fl-all % | 4.293 / 14.31 | 4.290 / 14.32 | 4.289 / 14.32 | 4.295 / 14.31 | 4.307 / 14.32 | |
sea-raft-s | KITTI 2015 train, EPE / Fl-all % | 1.054 / 3.13 | 1.054 / 3.13 | 1.054 / 3.13 | 1.054 / 3.13 | 1.054 / 3.14 | trained on this dataset's public images; not a zero-shot result |
sea-raft-s-kitti | KITTI 2015 train, EPE / Fl-all % | 0.936 / 2.66 | 0.936 / 2.66 | 0.936 / 2.66 | 0.935 / 2.66 | 0.935 / 2.65 | trained on this dataset's public images; not a zero-shot result |
sea-raft-s-spring | KITTI 2015 train, EPE / Fl-all % | 7.758 / 26.52 | 7.758 / 26.52 | 7.758 / 26.52 | 7.758 / 26.52 | 7.757 / 26.51 | trained on this dataset's public images; not a zero-shot result |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks f2992269+uncommitted, 2026-11-10; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6f0a70e1, 2026-11-17; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks f2992269+uncommitted, 2026-11-10.
Parity
CPU, float32: max |diff| <= 0.00025 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.002 and p99 <= 0.014 (absolute error of the output flow).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
sea-raft-m | 0.00103 / 0.00459 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, raft_flow@a101a33607b6:sm_120 |
sea-raft-m-kitti | 0.00085 / 0.00411 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, raft_flow@a101a33607b6:sm_120 |
sea-raft-m-spring | 0.00149 / 0.00741 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, raft_flow@a101a33607b6:sm_120 |
sea-raft-m-things | 0.00083 / 0.00347 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, raft_flow@a101a33607b6:sm_120 |
sea-raft-s | 0.00149 / 0.00788 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, raft_flow@a101a33607b6:sm_120 |
sea-raft-s-kitti | 0.00141 / 0.00847 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, raft_flow@a101a33607b6:sm_120 |
sea-raft-s-spring | 0.0027 / 0.01574 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, raft_flow@a101a33607b6:sm_120 |
Example output
One fixed input through this checkpoint, the same for every model of the task (portable · float16 · NVIDIA GeForce RTX 5060 Ti).
Input: Motorcycle, Middlebury 2014 stereo (left and right view, downscaled 4x), Scharstein et al., Middlebury College (research dataset, no licence stated).