mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-14 03:44:02 +08:00
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.
This commit is contained in:
1 parent
50e0e3c70c
commit
9a0ade8c0d
1 file changed
+8
-2
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user