Skip to content
Snippets Groups Projects
Commit 3e24ccbf authored by Thomas Müller-Höhne's avatar Thomas Müller-Höhne
Browse files

Fix broken colmap2nerf.py

parent 84c9fdd0
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ def parse_args(): ...@@ -37,7 +37,7 @@ def parse_args():
parser.add_argument("--skip_early", default=0, help="skip this many images from the start") parser.add_argument("--skip_early", default=0, help="skip this many images from the start")
parser.add_argument("--keep_colmap_coords", action="store_true", help="keep transforms.json in COLMAP's original frame of reference (this will avoid reorienting and repositioning the scene for preview and rendering)") parser.add_argument("--keep_colmap_coords", action="store_true", help="keep transforms.json in COLMAP's original frame of reference (this will avoid reorienting and repositioning the scene for preview and rendering)")
parser.add_argument("--out", default="transforms.json", help="output path") parser.add_argument("--out", default="transforms.json", help="output path")
parser.add_argument("--vocab_path", default="",help="vocabulary tree path") parser.add_argument("--vocab_path", default="", help="vocabulary tree path")
args = parser.parse_args() args = parser.parse_args()
return args return args
...@@ -85,13 +85,11 @@ def run_colmap(args): ...@@ -85,13 +85,11 @@ def run_colmap(args):
sys.exit(1) sys.exit(1)
if os.path.exists(db): if os.path.exists(db):
os.remove(db) os.remove(db)
match_cmd = f"colmap {args.colmap_matcher}_matcher --SiftMatching.guided_matching=true --database_path {db}" do_system(f"colmap feature_extractor --ImageReader.camera_model {args.colmap_camera_model} --ImageReader.camera_params \"{args.colmap_camera_params}\" --SiftExtraction.estimate_affine_shape=true --SiftExtraction.domain_size_pooling=true --ImageReader.single_camera 1 --database_path {db} --image_path {images}")
if args.vocab_path: match_cmd = f"colmap {args.colmap_matcher}_matcher --SiftMatching.guided_matching=true --database_path {db}"
match_cmd += f" --VocabTreeMatching.vocab_tree_path {args.vocab_path}" if args.vocab_path:
match_cmd += f" --VocabTreeMatching.vocab_tree_path {args.vocab_path}"
do_system(f"colmap feature_extractor --ImageReader.camera_model {args.colmap_camera_model} --ImageReader.camera_params \"{args.colmap_camera_params}\" --SiftExtraction.estimate_affine_shape=true --SiftExtraction.domain_size_pooling=true --ImageReader.single_camera 1 --database_path {db} --image_path {images}") do_system(match_cmd)
do_system(match_cmd)
try: try:
shutil.rmtree(sparse) shutil.rmtree(sparse)
except: except:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment