From 9a0ade8c0d0e1276519c9c084526f4ff0d27aed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ellensohn?= Date: Tue, 11 Aug 2026 08:11:02 +0200 Subject: [PATCH] Fix GPU SIFT flag names for COLMAP >=3.13 COLMAP's #3465 (released in 3.13.0) renamed the use_gpu/gpu_index options from SiftExtraction/SiftMatching to FeatureExtraction/ FeatureMatching, without keeping the old names as aliases. Discovered while wiring in the ROCm colmap fork's hip-integration branch (COLMAP 4.2.0.dev0), which would otherwise silently ignore --gpu since the old flag names error out under newer COLMAP. Version-gated using the same colmap_version check already used elsewhere in this file. --- nerfstudio/process_data/colmap_utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nerfstudio/process_data/colmap_utils.py b/nerfstudio/process_data/colmap_utils.py index 1d9405c81..9b4075914 100644 --- a/nerfstudio/process_data/colmap_utils.py +++ b/nerfstudio/process_data/colmap_utils.py @@ -115,6 +115,12 @@ def run_colmap( """ colmap_version = get_colmap_version(colmap_cmd) + # COLMAP's #3465 (released in 3.13.0) renamed the use_gpu/gpu_index options from + # SiftExtraction/SiftMatching to FeatureExtraction/FeatureMatching as part of + # generalizing feature extraction beyond SIFT; the old names were dropped, not kept + # as aliases, so this must be version-gated rather than always using one or the other. + use_gpu_extraction_prefix = "FeatureExtraction" if colmap_version >= Version("3.13") else "SiftExtraction" + use_gpu_matching_prefix = "FeatureMatching" if colmap_version >= Version("3.13") else "SiftMatching" colmap_database_path = colmap_dir / "database.db" colmap_database_path.unlink(missing_ok=True) @@ -126,7 +132,7 @@ def run_colmap( f"--image_path {image_dir}", "--ImageReader.single_camera 1", f"--ImageReader.camera_model {camera_model.value}", - f"--SiftExtraction.use_gpu {int(gpu)}", + f"--{use_gpu_extraction_prefix}.use_gpu {int(gpu)}", ] if camera_mask_path is not None: feature_extractor_cmd.append(f"--ImageReader.camera_mask_path {camera_mask_path}") @@ -140,7 +146,7 @@ def run_colmap( feature_matcher_cmd = [ f"{colmap_cmd} {matching_method}_matcher", f"--database_path {colmap_dir / 'database.db'}", - f"--SiftMatching.use_gpu {int(gpu)}", + f"--{use_gpu_matching_prefix}.use_gpu {int(gpu)}", ] if matching_method == "vocab_tree": vocab_tree_filename = get_vocab_tree()