Skip to content

Replacing VGGSfM tracker with VGGT tracker module#1035

Open
hkhanuja wants to merge 30 commits intomasterfrom
vggt_tracking_evaluation
Open

Replacing VGGSfM tracker with VGGT tracker module#1035
hkhanuja wants to merge 30 commits intomasterfrom
vggt_tracking_evaluation

Conversation

@hkhanuja
Copy link
Copy Markdown
Collaborator

This PR does 4 major things:

  1. Replaces VGGSfM tracker with VGGT tracker head
  2. Replaces loading for VGGT with loading and preprocessing from VGGT repo
  3. Camera, depth and tracking head is done in float32
  4. Non square images are now supported

Comment thread gtsfm/cluster_optimizer/cluster_vggt.py
Comment thread gtsfm/cluster_optimizer/cluster_vggt.py Outdated
Comment thread gtsfm/configs/vggt.yaml Outdated
Comment thread gtsfm/frontend/vggt.py Outdated
Comment thread gtsfm/frontend/vggt.py Outdated
Comment thread gtsfm/loader/loader_base.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request replaces the VGGSfM tracker with the VGGT tracker head module and updates image loading to support non-square images. The PR also introduces several algorithmic changes to bundle adjustment and translation averaging.

Changes:

  • Replaced VGGSfM tracker with VGGT track head implementation using vggsfm_utils module
  • Added new load_image_batch_vggt_loader method supporting both "crop" and "pad" modes for non-square images
  • Converted camera, depth, and tracking head computations to float32 precision
  • Added new evaluation and visualization tools for COLMAP reconstructions
  • Introduced nonlinear Sim3 trajectory alignment for cluster merging
  • Modified bundle adjustment to use hard equality constraints instead of soft priors
  • Changed translation averaging noise model dimension from 3 to 2

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
gtsfm/frontend/vggt.py Replaced VGGSfM tracker with VGGT track head; removed deprecated coordinate conversion functions; added float32 conversions
gtsfm/loader/loader_base.py Added new load_image_batch_vggt_loader method supporting non-square image preprocessing with crop/pad modes
gtsfm/cluster_optimizer/cluster_vggt.py Updated to use new VGGT loading method; removed image/inference resolution parameters; added pre-BA result storage
gtsfm/visualization/visualize_tracks.py New script for visualizing reprojection errors on COLMAP reconstructions
gtsfm/evaluation/compare_colmap_outputs_by_cluster.py New script for comparing cluster reconstructions against COLMAP baseline
gtsfm/cluster_merging.py Added nonlinear Sim3 merging support using TrajectoryAlignerSim3
gtsfm/common/gtsfm_data.py Added update_camera_pose method for modifying camera poses in-place
gtsfm/bundle/bundle_adjustment.py Changed first camera prior from soft PriorFactorPose3 to hard NonlinearEqualityPose3
gtsfm/averaging/translation/averaging_1dsfm.py Changed noise model dimension from 3 to 2; commented out Huber robust loss
gtsfm/configs/vggt.yaml Updated with new tracking parameters and removed resolution settings
gtsfm/configs/vggt_megaloc.yaml New configuration file for VGGT with MegaLoc descriptor
gtsfm/scene_optimizer.py Added support for nonlinear Sim3 alignment; changed metrics saving condition
gtsfm/runner.py Increased default worker memory limit from 16GB to 32GB
gtsfm/utils/metrics.py Added store_full_data parameter to metrics functions
gtsfm/evaluation/metrics.py Added rounding to 4 decimal places for scalar metrics
gtsfm/evaluation/compare_colmap_outputs.py Added camera center visualization and CSV export functionality
gtsfm/cluster_optimizer/cluster_optimizer_cacher.py Added cache subdirectory support and VGGT output re-export
gtsfm/cluster_optimizer/cluster_optimizer_base.py Added run_bundle_adjustment_on_leaf parameter
create_tracks_viz.sh New shell script with example visualization commands
.gitignore Added pattern to ignore result directories

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gtsfm/evaluation/metrics.py
Comment thread gtsfm/bundle/bundle_adjustment.py Outdated
Comment thread gtsfm/configs/vggt.yaml Outdated
Comment thread gtsfm/loader/loader_base.py Outdated
Comment thread gtsfm/cluster_merging.py
Comment on lines +56 to +71
aTi_measurements = _create_unary_measurements(parent_scene)
parent_camera_ids = set(parent_scene.get_valid_camera_indices())
valid_child_scenes = []

for i, child_scene in enumerate(children_scenes):
child_camera_ids = set(child_scene.get_valid_camera_indices())
common_camera_ids = parent_camera_ids & child_camera_ids
if len(common_camera_ids) == 0:
logger.warning("Child scene %d has insufficient overlap with parent, skipping", i)
continue
valid_child_scenes.append(child_scene)

if len(valid_child_scenes) == 0:
return parent_scene

aTi_measurements = _create_unary_measurements(parent_scene)
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 56 creates aTi_measurements which is then overwritten on line 71 with the exact same call. The first assignment is redundant and should be removed. This appears to be duplicate code.

Copilot uses AI. Check for mistakes.
Comment thread create_tracks_viz.sh Outdated
Comment thread gtsfm/averaging/translation/averaging_1dsfm.py Outdated
Comment thread gtsfm/evaluation/compare_colmap_outputs.py
Comment thread gtsfm/frontend/vggt.py
Comment thread gtsfm/evaluation/compare_colmap_outputs_by_cluster.py
Comment thread gtsfm/evaluation/compare_colmap_outputs_by_cluster.py
Comment thread gtsfm/configs/vggt.yaml Outdated
Comment thread gtsfm/configs/vggt_megaloc.yaml Outdated
Comment thread gtsfm/loader/loader_base.py Outdated
Comment thread create_tracks_viz.sh Outdated
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.

4 participants