All models

raft_small

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,348 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 (337 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
990.2K
Operations
1,348
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
m8562
Graph hash
11b262a63a8dc95978b6f153ba53f81c5e7a62e521f82ef24f08cb6e2c00e059
Skeleton hash
1024af1b5529129a8c218e819730e9c50972e09aaa5a7a35c31d95bf2dbf4a85
Architecture hash
75be74575591d23afa1d26b50b07060809e46ab5a8259e4f2d068533da2f0621
Diagram SHA-256
90452d3b88231474458f9238c6156e03573118a41fd97d3f396640434975a900
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

The small build keeps the same loop with about a fifth of the parameters; the paper's smaller version of RAFT with 1/5 of the parameters runs at 20 frames per second.

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}, 
}