mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-26 10:59:53 +08:00
Merge 9a0ade8c0d into 50e0e3c70c
This commit is contained in:
1 file changed
+8
-2
@@ -115,6 +115,12 @@ def run_colmap(
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
colmap_version = get_colmap_version(colmap_cmd)
|
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 = colmap_dir / "database.db"
|
||||||
colmap_database_path.unlink(missing_ok=True)
|
colmap_database_path.unlink(missing_ok=True)
|
||||||
@@ -126,7 +132,7 @@ def run_colmap(
|
|||||||
f"--image_path {image_dir}",
|
f"--image_path {image_dir}",
|
||||||
"--ImageReader.single_camera 1",
|
"--ImageReader.single_camera 1",
|
||||||
f"--ImageReader.camera_model {camera_model.value}",
|
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:
|
if camera_mask_path is not None:
|
||||||
feature_extractor_cmd.append(f"--ImageReader.camera_mask_path {camera_mask_path}")
|
feature_extractor_cmd.append(f"--ImageReader.camera_mask_path {camera_mask_path}")
|
||||||
@@ -140,7 +146,7 @@ def run_colmap(
|
|||||||
feature_matcher_cmd = [
|
feature_matcher_cmd = [
|
||||||
f"{colmap_cmd} {matching_method}_matcher",
|
f"{colmap_cmd} {matching_method}_matcher",
|
||||||
f"--database_path {colmap_dir / 'database.db'}",
|
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":
|
if matching_method == "vocab_tree":
|
||||||
vocab_tree_filename = get_vocab_tree()
|
vocab_tree_filename = get_vocab_tree()
|
||||||
|
|||||||
Reference in new issue
Block a user