Papers › GMFlow: Learning Optical Flow via Global Matching

GMFlow: Learning Optical Flow via Global Matching

26 Nov 2021CVPR 2022 1arXiv:2111.13680archive 2025-07-28

Haofei Xu, Jing Zhang, Jianfei Cai, Hamid Rezatofighi, DaCheng Tao

Learning-based optical flow estimation has been dominated with the pipeline of cost volume with convolutions for flow regression, which is inherently limited to local correlations and thus is hard to address the long-standing challenge of large displacements. To alleviate this, the state-of-the-art framework RAFT gradually improves its prediction quality by using a large number of iterative refinements, achieving remarkable performance but introducing linearly increasing inference time. To enable both high accuracy and efficiency, we completely revamp the dominant flow regression pipeline by reformulating optical flow as a global matching problem, which identifies the correspondences by directly comparing feature similarities. Specifically, we propose a GMFlow framework, which consists of three main components: a customized Transformer for feature enhancement, a correlation and softmax layer for global feature matching, and a self-attention layer for flow propagation. We further introduce a refinement step that reuses GMFlow at higher feature resolution for residual flow prediction. Our new framework outperforms 31-refinements RAFT on the challenging Sintel benchmark, while using only one refinement and running faster, suggesting a new paradigm for accurate and efficient optical flow estimation. Code is available at https://github.com/haofeixu/gmflow.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 19 code samples harvested from 2 repositories linked to this paper: 14 ran (of which 0 constructed an object rather than computing a result; 13 with no instrument failure: 1 honoured, 0 violated, 12 with no contract checked; 1 where Syntology's instrument failed) · 5 unverified. Where Syntology's instrument failed: 1 where our contract draft was wrong; failures of Syntology's instrument, not of the code.

By repository: official repository: 15 samples from 1 repository, 11 ran (10 with no instrument failure; 1 where Syntology's instrument failed); community (archive-listed): 4 samples from 1 repository, 3 ran (3 with no instrument failure; 0 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 1 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-22 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

haofeixu/gmflow officialmentioned in papermentioned on GitHubpytorchApache-2.0Syntology: 15 samples, 11 ran (1 instrument-failed) · 4 unverified report
autonomousvision/unimatch mentioned on GitHubpytorchMITSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to DepthSplat: Connecting Gaussian Splatting and Depth (arXiv:2410.13862; that paper's own run record: 10 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 2 honoured, 2 violated, 3 with no contract checked; 3 where Syntology's instrument failed) · 6 unverified); nothing checks that they implement this paper's method. report
hpcforge/gmflow mentioned on GitHubpytorchnot reachable when probed 2026-09-17 — repositories for recent papers often appear after camera-readySyntology: not harvested report
raymondwang987/nvds mentioned on GitHubpytorchMITSyntology: 4 samples, 3 ran (0 instrument-failed) · 1 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

19 samples harvested: 14 ran (of which 0 constructed an object rather than computing a result; 13 with no instrument failure: 1 honoured, 0 violated, 12 with no contract checked; 1 where Syntology's instrument failed) · 5 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · honoured contract
1ran · our draft was wrong
12ran
5unverified

Licence: 7 of the 19 samples are pointer only, meaning Syntology does not serve that copy's text. For 7 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

haofeixu/gmflow official repository 15 samples, 11 ran (1 instrument-failed) · 4 unverified
compute_color in 11 papers utils/flow_viz.py ran · honoured contract fingerprinted Apache-2.0 (permissive) here; the stored copy is pointer only · abcbf43ad9fe6129 · report fixture: signature u:ndarray/2/float, v:ndarray/2/float · returned ndarray · level recorded 2026-09-24
coords_grid in 24 papers gmflow/geometry.py ran Apache-2.0 (permissive) here; the stored copy is pointer only · 134980aa63271fbb · report fixture: signature b:int/0/int, h:int/0/int, w:int/0/int, homogeneous:bool/0/bool, device:NoneType/0/? · returned Tensor · level recorded 2026-09-25
flow_compute_color in 7 papers utils/flow_viz.py ran Apache-2.0 (permissive) · 215f62561b03c262 · report fixture: signature u:ndarray/2/float, v:ndarray/2/float, convert_to_bgr:bool/0/bool · returned ndarray · level recorded 2026-09-25
flow_loss_func loss.py ran Apache-2.0 (permissive) here; the stored copy is pointer only · 715a9e324491547b · report fixture: signature flow_preds:list/1/Tensor, flow_gt:Tensor/4/float, valid:Tensor/3/float, gamma:float/0/float, max_flow:int/0/int · returned tuple · level recorded 2026-09-26
flow_to_color in 10 papers utils/flow_viz.py ran Apache-2.0 (permissive) · d59fe7ab39463182 · report fixture: signature flow_uv:ndarray/3/float, clip_flow:float/0/float, convert_to_bgr:bool/0/bool · returned ndarray · level recorded 2026-09-25
generate_shift_window_attn_mask gmflow/transformer.py ran Apache-2.0 (permissive) · a69f1d64c1b71d23 · report fixture: returned Tensor · level recorded 2026-09-24
generate_window_grid gmflow/geometry.py ran Apache-2.0 (permissive) · 0823d84f9697f2a7 · report fixture: signature h_min:float/0/float, h_max:float/0/float, w_min:float/0/float, w_max:float/0/float, len_h:int/0/int, len_w:int/0/int, device:device/0/? · returned Tensor · level recorded 2026-09-24
merge_splits gmflow/utils.py ran Apache-2.0 (permissive) here; the stored copy is pointer only · 6dc05be22af3598b · report fixture: signature splits:Tensor/4/float, num_splits:int/0/int, channel_last:bool/0/bool · returned Tensor · level recorded 2026-09-26
normalize_img in 12 papers gmflow/utils.py ran fingerprinted Apache-2.0 (permissive) · b1ba789ed7470207 · report fixture: signature img0:Tensor/4/float, img1:Tensor/4/float · returned tuple · level recorded 2026-09-24
single_head_full_attention in 7 papers gmflow/transformer.py ran · our draft was wrong fingerprinted Apache-2.0 (permissive) here; the stored copy is pointer only · 52b500940a8025a3 · report fixture: signature q:Tensor/3/float, k:Tensor/3/float, v:Tensor/3/float · returned Tensor · level recorded 2026-09-22
split_feature in 8 papers gmflow/utils.py ran Apache-2.0 (permissive) here; the stored copy is pointer only · 4df5b1dd5d60d6cb · report fixture: signature feature:Tensor/4/float, num_splits:int/0/int, channel_last:bool/0/bool · returned Tensor · level recorded 2026-09-26
global_correlation_softmax gmflow/matching.py unverified Apache-2.0 (permissive) · d5a86279192fe3ae · report
local_correlation_softmax gmflow/matching.py unverified Apache-2.0 (permissive) · d9223ffb6230f989 · report
normalize_coords in 7 papers gmflow/geometry.py unverified Apache-2.0 (permissive) · 8d0dd2c61c5c3d89 · report
single_head_split_window_attention gmflow/transformer.py unverified Apache-2.0 (permissive) here; the stored copy is pointer only · 9a948b3b755e6516 · report
raymondwang987/nvds community (archive-listed) 4 samples, 3 ran (0 instrument-failed) · 1 unverified
compute_errors in 41 papers infer_NVDS_dpt_bi.py ran MIT (permissive) · b6528bfa48fa18a0 · report fixture: signature pred:Tensor/1/float, gt:Tensor/1/float, mask:Tensor/1/bool · returned tuple · level recorded 2026-09-24
compute_scale_and_shift in 8 papers infer_NVDS_dpt_bi.py ran MIT (permissive) · d3e701ed2a0c860a · report fixture: signature prediction:Tensor/3/float, target:Tensor/3/float, mask:Tensor/3/float · returned tuple · level recorded 2026-09-24
normalize_prediction_test smooth_loss.py ran MIT (permissive) · 7e90a3df0831de3d · report fixture: signature target:Tensor/2/float, mask:Tensor/2/bool · returned Tensor · level recorded 2026-09-24
normalize_prediction_robust infer_NVDS_dpt_bi.py unverified MIT (permissive) · 959c2141efd7f746 · report

Tasks

Optical Flow Estimationregression

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Optical Flow Estimation Spring GMFlow 1px total 10.355 #9 of 11 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections