From 3e24ccbfcff3b82a48c8abea025f0768e68478c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Mu=CC=88ller-Ho=CC=88hne?= <thomas94@gmx.net>
Date: Thu, 7 Jul 2022 07:28:49 +0200
Subject: [PATCH] Fix broken colmap2nerf.py

---
 scripts/colmap2nerf.py | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/scripts/colmap2nerf.py b/scripts/colmap2nerf.py
index 9459f04..b3fdfe8 100755
--- a/scripts/colmap2nerf.py
+++ b/scripts/colmap2nerf.py
@@ -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("--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("--vocab_path", default="",help="vocabulary tree path")
+	parser.add_argument("--vocab_path", default="", help="vocabulary tree path")
 	args = parser.parse_args()
 	return args
 
@@ -85,13 +85,11 @@ def run_colmap(args):
 		sys.exit(1)
 	if os.path.exists(db):
 		os.remove(db)
-    match_cmd = f"colmap {args.colmap_matcher}_matcher --SiftMatching.guided_matching=true --database_path {db}"
-    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(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}")
+	match_cmd = f"colmap {args.colmap_matcher}_matcher --SiftMatching.guided_matching=true --database_path {db}"
+	if args.vocab_path:
+		match_cmd += f" --VocabTreeMatching.vocab_tree_path {args.vocab_path}"
+	do_system(match_cmd)
 	try:
 		shutil.rmtree(sparse)
 	except:
-- 
GitLab