Skip to content

Use FlexGlue for keyframing, tracking and loop closure - #57

Merged
Zador-Pataki merged 3 commits into
mainfrom
zador/flexglue-integration
Nov 4, 2026
Merged

Zador-Pataki merged 3 commits into
mainfrom
zador/flexglue-integration

Conversation

@Zador-Pataki

@Zador-Pataki Zador-Pataki commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Use FlexGlue for sparse keyframe queries and RoMaV2 refinement for accurate tracking and loop-closure matches. Nearby video frames typically require less reasoning to match, so we exploit FlexGlue’s configurable depth to use fewer transformer layers for sequential matching while retaining the full model for loop closures. Early rejection saves runtime by rejecting unsuitable pairs before matching finishes, while pair rejection protects against visual aliasing.

Changes

  • Make FlexGlue the default; retain RoMaV2 through matcher.name.
  • Use 6 FlexGlue transformer layers for keyframing and temporal tracking, and all 9 for retrieval-based loop-closure matching.
  • Reject pairs whose FlexGlue pair-confidence score is below 0.8. An early-stop decay of 0.2 controls how the rejection threshold changes across layers. Adjacent keyframe pairs are always kept to preserve temporal connectivity.
  • Reuse image features and the RoMa refinement implementation, with compiled inference and asynchronous image transfers.

Known regression and follow-up

In some scenarios that are impossible to match, RoMaV2 hallucinates matches while FlexGlue produces very few noisy matches. FlexGlue's pair-rejection head flags these cases, but adjacent keyframe pairs are currently protected from rejection.

FlexGlue largely ignores the unmatchable frame, while local loop closures constrain the frames before and after it. This often gives better trajectory accuracy than RoMaV2, but the unsupported frame can float away and contribute an evaluation outlier. We could use the doppelganger head to reject the pair, then filter the unsupported frame or constrain it with a temporal smoothness prior.

Runtime

RTX 4090, three 129-frame ETH3D clips; two measured repeats after warm-up. Both use the same tracking timeline and LC pairs. Coarse inputs: FlexGlue 512 px, RoMa 560 px; refinement: 1200 px.

Stage Unit RoMaV2 FlexGlue Speedup
Keyframe selection ms/input-frame transition 27.44 23.93 1.15×
Track propagation ms/new keyframe 251.44 209.76 1.20×
Loop-closure matching ms/candidate pair 69.83 57.84 1.21×
Benchmark results: RoMaV2 and FlexGlue

Both methods use LC-only feature retention and deduplication, with loop-closure weight 1×.

ETH3D monocular · 55 scenes · Pose AUC

Method ATE (m) ↓ 5 cm 10 cm 50 cm 1 m 10 m
RoMaV2 0.268 80.32 87.85 95.86 97.35 99.28
FlexGlue 0.066 81.64 87.78 94.79 96.79 99.54

EuRoC monocular · 11 scenes · Pose AUC

Method ATE (m) ↓ 5 cm 10 cm 50 cm 1 m 10 m
RoMaV2 0.044 28.44 59.74 91.91 95.95 99.60
FlexGlue 0.044 29.32 60.40 92.04 96.02 99.60

CroCoDL · 64 scenes · W-AUC at 5%

Method ATE (m) ↓ 10 m 25 m 50 m 100 m Full
RoMaV2 0.233 95.72 97.27 97.39 96.56 98.21
FlexGlue 0.284 95.38 96.75 96.70 96.60 98.03

LaMAR 300 · 50 scenes · W-AUC at 5%

Method ATE (m) ↓ 10 m 25 m 50 m 100 m Full
RoMaV2 0.878 92.43 93.08 91.79 91.03 90.41
FlexGlue 0.916 92.78 93.87 92.90 91.99 90.83

LaMAR older selection · 53 evaluated trajectories · W-AUC at 5%

These results do not cover the current complete testset (128 recordings).

Method ATE (m) ↓ 10 m 25 m 50 m 100 m Full
RoMaV2 1.452 92.42 92.83 92.38 92.59 89.76
FlexGlue 1.361 92.51 93.18 93.08 92.91 90.88

Spires rectified monocular · 10 scenes · W-AUC at 5%

Method ATE (m) ↓ 10 m 25 m 50 m 100 m Full
RoMaV2 0.130 98.98 99.10 99.11 99.10 99.54
FlexGlue 0.123 98.98 99.08 99.06 99.06 99.52

Hilti forward monocular · 30 scenes · W-AUC at 5%

Method ATE (m) ↓ 10 m 25 m 50 m 100 m Full
RoMaV2 0.822 93.96 93.96 93.29 92.44 94.46
FlexGlue 0.518 94.70 95.41 95.63 95.01 96.36

Hilti three-view · 30 scenes · W-AUC at 5%

Method ATE (m) ↓ 10 m 25 m 50 m 100 m Full
RoMaV2 0.206 94.80 96.22 96.94 97.21 98.13
FlexGlue 0.253 94.55 95.85 96.56 96.81 97.93

Spires three-camera rig · 13 scenes · W-AUC at 5%

Method ATE (m) ↓ 10 m 25 m 50 m 100 m Full
RoMaV2 0.119 99.15 99.24 99.26 99.28 99.59
FlexGlue 0.088 99.17 99.30 99.36 99.43 99.68

@Zador-Pataki
Zador-Pataki marked this pull request as ready for review November 4, 2026 01:58
Base automatically changed from zador/expanded-benchmark-datasets to main November 4, 2026 21:05
@Zador-Pataki
Zador-Pataki merged commit 51cc4b4 into main Nov 4, 2026
1 check passed
@Zador-Pataki
Zador-Pataki deleted the zador/flexglue-integration branch November 4, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant