All models

raft_large

Iterative optical flow from all-pairs correlation volumes and a convolutional GRU, traced as torchvision's large and small builds over 12 updates.

Depth estimation · 1,633 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (347 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
RAFT
Parameters
5.3M
Operations
1,633
Framework
PyTorch
Recurrent
Yes
Published
ECCV 2020
Cited by
141 (as of 5 October 2026)
Authors
Zachary Teed, Jia Deng
License
BSD-3-Clause
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m8561
Graph hash
c1fa37295f9b39a354bcecc322dd911eafa46f9c1ca20de0bd6541ac3a53a67e
Skeleton hash
eea5d8d5e521a4a8852138b56e00dba0a79158b2367784898329063177739210
Architecture hash
20b26ea00f92f10f4de0b7af995b5462493c9c8d72e241300bf30227438a21b8
Diagram SHA-256
770c961840cbcdd3af70195a800a5126c15110d87a74a6cfba409661892e2ff7
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

About this model's family

RAFT, Recurrent All-Pairs Field Transforms, is Zachary Teed and Jia Deng's optical flow network: given two frames it predicts, for every pixel of the first, where that pixel went in the second. It is worth a close look because it replaced the coarse-to-fine pyramids of earlier flow networks with a single iterative loop, and the paper reports state-of-the-art performance with it. On KITTI RAFT reaches an F1-all error of 5.10%, a 16% error reduction from the best published result (6.10%), and on Sintel (final pass) an end-point-error of 2.855 pixels, a 30% error reduction from the best published result (4.098 pixels).

The design has three main components: a feature encoder that extracts a feature vector for each pixel, a correlation layer that produces a 4D correlation volume for all pairs of pixels, with subsequent pooling to produce lower resolution volumes, and a recurrent GRU-based update operator that retrieves values from the correlation volumes and iteratively updates a flow field initialized at zero. The encoder outputs features at 1/8 resolution with D = 256 channels, built from 6 residual blocks, 2 at 1/2 resolution, 2 at 1/4 resolution, and 2 at 1/8 resolution, and a separate context network extracts features only from the first input image. The update step is a gated activation unit based on the GRU cell, with fully connected layers replaced with convolutions, and the authors adopt from TrellisNet and DEQ the core idea of using a large number of weight-tied units. That operator has only 2.7M parameters and can be applied 100+ times during inference without divergence.

Because the network outputs optical flow at 1/8 resolution, a final upsampling step takes the full resolution flow at each pixel to be the convex combination of a 3x3 grid of its coarse resolution neighbours, which is why each traced member emits a stack of full-size two-channel flow fields, one per update iteration. Two members are captured, the full model and the small one: a smaller version of RAFT with 1/5 of the parameters runs at 20 frames per second while still outperforming all prior methods on Sintel. The authors' repository also offers an alternate correlation implementation that is somewhat slower than all-pairs, but uses significantly less GPU memory.

Key idea. A single-resolution iterative design: all-pairs 4D correlation volumes read by a convolutional GRU that refines a flow field over many weight-tied updates, instead of a coarse-to-fine pyramid.

  • raft
  • recurrent all-pairs field transforms
  • raft_large
  • raft_small
  • optical flow
  • flow estimation
  • teed deng
  • correlation volume
  • gru update operator
  • torchvision optical flow

AI-written summary, checked automatically against its sources; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{teed2020raftrecurrentallpairsfield,
      title={RAFT: Recurrent All-Pairs Field Transforms for Optical Flow}, 
      author={Zachary Teed and Jia Deng},
      year={2020},
      eprint={2003.12039},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2003.12039}, 
}