feat(colmap): integrate EXIF pose prior, GPS alignment, model normalization… #3705
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Integrate COLMAP EXIF Pose Priors, GPS Alignment, Model Normalization, Geo-Alignment Export, and EXIF/Downscale Robustness Fixes
Background & Motivation
pose_prior_mapper
ormodel_aligner
directly.No pose priors in database...
).-map ""
when--num-downscales > 0
.What’s Changed
pose_prior_mapper
support (symmetric std + overwrite priors covariance option).model_aligner
to align the SfM model to GPS priors; writes back intosparse/0
.matching_method="spatial"
(fallback tovocab_tree
for toolchains that don’t support spatial; hloc branch always maps tovocab_tree
).normalize_model
step: estimate center and scale from COLMAP points, write a single-line transform filenormalization_transform.txt
(s qw qx qy qz tx ty tz
using identity quaternion), invokecolmap model_transformer --transform_path
in-place.-map_metadata 0
to all outputs.-map
construction for--num-downscales > 0
(no empty maps, no unconnected outputs).get_vocab_tree()
now fetches a FAISS-compatible vocab tree (if targeting upstream, switch back to the official URL or add auto-upgrade/rebuild logic).ns-export gaussian-splat
, writegeo_transforms.json
containing:dataparser_inverse.matrix
(4×4)normalization_inverse.matrix
(4×4, plus originalscale/quaternion/translation
)composite_train_to_ecef.matrix
(4×4)composite_train_to_ecef_dataparser
: dataparser-style{ transform (3×4), scale }
to make downstream usage consistent withdataparser_transforms.json
New/Updated CLI Arguments (data processing)
--use-pose-prior
: enablepose_prior_mapper
.--prior-position-std
: EXIF pose prior std in meters.--align-model-to-priors
,--alignment-max-error
: enable and configuremodel_aligner
.--matching-method spatial
: usespatial_matcher
(fallback if unsupported).--normalize-model
: enable normalization (model_transformer
).--normalization-center {bbox|mean}
: choose center estimation (defaultbbox
).--normalization-target-diagonal
and--normalization-scale
(the explicitscale
takes precedence).Compatibility & Impact
colmap/sparse/0
); downstream readers remain unchanged.Files Changed
nerfstudio/process_data/colmap_utils.py
run_colmap(...)
withspatial
matching,pose_prior_mapper
,model_aligner
, and normalization (writenormalization_transform.txt
and callmodel_transformer
), and remove hard-coded GPU flags for broader compatibility.nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py
matching_method
withspatial
, pose priors, alignment, normalization). Mapspatial
→vocab_tree
for hloc branch.nerfstudio/process_data/process_data_utils.py
-map_metadata 0
when re-encoding/downscaling.-map
generation for--num-downscales > 0
(no empty maps, no unconnected outputs).nerfstudio/utils/scripts.py
run_command
: nodecode
crash whenstderr=None
under--verbose
; show clearer error messages.nerfstudio/scripts/exporter.py
gaussian-splat
export, writegeo_transforms.json
with inverse and composite transforms, including a dataparser-style{ transform, scale }
for the composite mapping.Outcomes
pose_prior_mapper
can read priors from DB.How to Run (from source)
python -m nerfstudio.scripts.process_data images --data DATA --output-dir OUT --camera-type perspective --matching-method vocab_tree --use-pose-prior --prior-position-std 2 --align-model-to-priors --normalize-model --normalization-center bbox --normalization-target-diagonal 4.0 --colmap-cmd colmap --no-verbose
python -m nerfstudio.scripts.train splatfacto --data OUT --pipeline.model.camera-optimizer.mode SO3xR3 --pipeline.model.use_scale_regularization True colmap --center-method none --auto-scale-poses False
geo_transforms.json
):python -m nerfstudio.scripts.exporter gaussian-splat --load-config RUN/config.yml --output-dir EXPORT_DIR
Frontend / 3D Engine (brief)
geo_transforms.json
:composite_train_to_ecef_dataparser
and applyx_ecef = s · (R · x_train + t)
.Known Issues & Notes
vocab_tree_builder
.spatial_matcher
availability depends on the COLMAP build; fallback isvocab_tree
/exhaustive
.Validation
pose_prior_mapper
,model_aligner
, andDone normalizing model
.colmap/sparse/0
contains{cameras.bin, images.bin, points3D.bin}
.geo_transforms.json
is produced successfully.