From ebe6f0a0df1450e72769827091ba21aaaa90fbae Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Wed, 4 Sep 2024 05:30:56 -0700 Subject: [PATCH 01/14] adding glomap toggle to our datasets, requires latest version of COLMAP --- .../colmap_converter_to_nerfstudio_dataset.py | 13 ++++++++++++ nerfstudio/process_data/colmap_utils.py | 21 +++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py b/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py index ec82f0ad7f..a63da07285 100644 --- a/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py +++ b/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py @@ -222,6 +222,19 @@ def _run_colmap(self, mask_path: Optional[Path] = None): refine_intrinsics=self.refine_intrinsics, colmap_cmd=self.colmap_cmd, ) + elif sfm_tool == "glomap": + colmap_utils.run_colmap( + image_dir=image_dir, + colmap_dir=self.absolute_colmap_path, + camera_model=CAMERA_MODELS[self.camera_type], + camera_mask_path=mask_path, + gpu=self.gpu, + verbose=self.verbose, + matching_method=self.matching_method, + refine_intrinsics=self.refine_intrinsics, + colmap_cmd=self.colmap_cmd, + glomap_toggle=True, + ) elif sfm_tool == "hloc": if mask_path is not None: raise RuntimeError("Cannot use a mask with hloc. Please remove the cropping options " "and try again.") diff --git a/nerfstudio/process_data/colmap_utils.py b/nerfstudio/process_data/colmap_utils.py index 1d9405c81a..bd68f2856b 100644 --- a/nerfstudio/process_data/colmap_utils.py +++ b/nerfstudio/process_data/colmap_utils.py @@ -99,6 +99,7 @@ def run_colmap( matching_method: Literal["vocab_tree", "exhaustive", "sequential"] = "vocab_tree", refine_intrinsics: bool = True, colmap_cmd: str = "colmap", + glomap_toggle: bool = False, ) -> None: """Runs COLMAP on the images. @@ -153,12 +154,20 @@ def run_colmap( # Bundle adjustment sparse_dir = colmap_dir / "sparse" sparse_dir.mkdir(parents=True, exist_ok=True) - mapper_cmd = [ - f"{colmap_cmd} mapper", - f"--database_path {colmap_dir / 'database.db'}", - f"--image_path {image_dir}", - f"--output_path {sparse_dir}", - ] + if glomap_toggle: + mapper_cmd = [ + f"glomap mapper", + f"--database_path {colmap_dir / 'database.db'}", + f"--image_path {image_dir}", + f"--output_path {sparse_dir}", + ] + else: + mapper_cmd = [ + f"{colmap_cmd} mapper", + f"--database_path {colmap_dir / 'database.db'}", + f"--image_path {image_dir}", + f"--output_path {sparse_dir}", + ] if colmap_version >= Version("3.7"): mapper_cmd.append("--Mapper.ba_global_function_tolerance=1e-6") From 9b15e888eca58bd9cc49fb722a3830ec13e8fc53 Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Wed, 4 Sep 2024 05:45:21 -0700 Subject: [PATCH 02/14] adding type to variable that can be accessed from the CLI --- .../process_data/colmap_converter_to_nerfstudio_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py b/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py index a63da07285..98c40c3029 100644 --- a/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py +++ b/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py @@ -35,7 +35,7 @@ class ColmapConverterToNerfstudioDataset(BaseConverterToNerfstudioDataset): """Feature matching method to use. Vocab tree is recommended for a balance of speed and accuracy. Exhaustive is slower but more accurate. Sequential is faster but should only be used for videos.""" - sfm_tool: Literal["any", "colmap", "hloc"] = "any" + sfm_tool: Literal["any", "colmap", "glomap", "hloc"] = "any" """Structure from motion tool to use. Colmap will use sift features, hloc can use many modern methods such as superpoint features and superglue matcher""" refine_pixsfm: bool = False From d49e6f5673659d3f4f2243390b4d41887b8d443d Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Wed, 4 Sep 2024 17:36:07 -0700 Subject: [PATCH 03/14] simplifying mapper --- nerfstudio/process_data/colmap_utils.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/nerfstudio/process_data/colmap_utils.py b/nerfstudio/process_data/colmap_utils.py index bd68f2856b..7f2357d221 100644 --- a/nerfstudio/process_data/colmap_utils.py +++ b/nerfstudio/process_data/colmap_utils.py @@ -154,20 +154,12 @@ def run_colmap( # Bundle adjustment sparse_dir = colmap_dir / "sparse" sparse_dir.mkdir(parents=True, exist_ok=True) - if glomap_toggle: - mapper_cmd = [ - f"glomap mapper", - f"--database_path {colmap_dir / 'database.db'}", - f"--image_path {image_dir}", - f"--output_path {sparse_dir}", - ] - else: - mapper_cmd = [ - f"{colmap_cmd} mapper", - f"--database_path {colmap_dir / 'database.db'}", - f"--image_path {image_dir}", - f"--output_path {sparse_dir}", - ] + mapper_cmd = [ + f"{'glomap' if glomap_toggle else colmap_cmd} mapper", + f"--database_path {colmap_dir / 'database.db'}", + f"--image_path {image_dir}", + f"--output_path {sparse_dir}", +] if colmap_version >= Version("3.7"): mapper_cmd.append("--Mapper.ba_global_function_tolerance=1e-6") From 5986467cae569363f449d15b67a345e84a3b1bf7 Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Wed, 4 Sep 2024 17:52:17 -0700 Subject: [PATCH 04/14] ruff --- nerfstudio/process_data/colmap_utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nerfstudio/process_data/colmap_utils.py b/nerfstudio/process_data/colmap_utils.py index 7f2357d221..12aa488480 100644 --- a/nerfstudio/process_data/colmap_utils.py +++ b/nerfstudio/process_data/colmap_utils.py @@ -155,11 +155,11 @@ def run_colmap( sparse_dir = colmap_dir / "sparse" sparse_dir.mkdir(parents=True, exist_ok=True) mapper_cmd = [ - f"{'glomap' if glomap_toggle else colmap_cmd} mapper", - f"--database_path {colmap_dir / 'database.db'}", - f"--image_path {image_dir}", - f"--output_path {sparse_dir}", -] + f"{'glomap' if glomap_toggle else colmap_cmd} mapper", + f"--database_path {colmap_dir / 'database.db'}", + f"--image_path {image_dir}", + f"--output_path {sparse_dir}", + ] if colmap_version >= Version("3.7"): mapper_cmd.append("--Mapper.ba_global_function_tolerance=1e-6") From 99adeabe2520c073033f1bbbfff49b1c7d5a9871 Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Fri, 6 Sep 2024 01:20:38 -0700 Subject: [PATCH 05/14] working GLOMAP --- nerfstudio/process_data/colmap_utils.py | 2 +- nerfstudio/process_data/process_data_utils.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nerfstudio/process_data/colmap_utils.py b/nerfstudio/process_data/colmap_utils.py index 12aa488480..189c141780 100644 --- a/nerfstudio/process_data/colmap_utils.py +++ b/nerfstudio/process_data/colmap_utils.py @@ -160,7 +160,7 @@ def run_colmap( f"--image_path {image_dir}", f"--output_path {sparse_dir}", ] - if colmap_version >= Version("3.7"): + if colmap_version >= Version("3.7") and glomap_toggle != True: mapper_cmd.append("--Mapper.ba_global_function_tolerance=1e-6") mapper_cmd = " ".join(mapper_cmd) diff --git a/nerfstudio/process_data/process_data_utils.py b/nerfstudio/process_data/process_data_utils.py index b5b2391a09..5cdb20c578 100644 --- a/nerfstudio/process_data/process_data_utils.py +++ b/nerfstudio/process_data/process_data_utils.py @@ -482,7 +482,7 @@ def downscale_images( def find_tool_feature_matcher_combination( - sfm_tool: Literal["any", "colmap", "hloc"], + sfm_tool: Literal["any", "colmap", "glomap", "hloc"], feature_type: Literal[ "any", "sift", @@ -556,6 +556,12 @@ def find_tool_feature_matcher_combination( if (feature_type not in ("any", "sift")) or (matcher_type not in ("any", "NN")): return (None, None, None) return ("colmap", "sift", "NN") + + if sfm_tool == "glomap": + if (feature_type not in ("any", "sift")) or (matcher_type not in ("any", "NN")): + return (None, None, None) + return ("glomap", "sift", "NN") + if sfm_tool == "hloc": if feature_type in ("any", "superpoint"): feature_type = "superpoint_aachen" From 38ff77a5627efe6401864b1d6b417e6902ba2cbd Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Fri, 6 Sep 2024 01:37:42 -0700 Subject: [PATCH 06/14] added documentation for installation --- docs/quickstart/custom_dataset.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/quickstart/custom_dataset.md b/docs/quickstart/custom_dataset.md index 6444ca4456..7c9556008c 100644 --- a/docs/quickstart/custom_dataset.md +++ b/docs/quickstart/custom_dataset.md @@ -141,6 +141,29 @@ cd vcpkg (polycam)= +### Installing GLOMAP + +GLOMAP is a global structure-from-motion method that is up to 100x faster than COLMAP. It is highly recommended if you would like to extract poses from video. The best way to install GLOMAP is through the official instructions, which have been copied below: + +::::::{tab-set} +:::::{tab-item} Linux + +Clone the glomap repository and build GLOMAP: + +``` +git clone https://github.com/colmap/glomap.git +mkdir build +cd build +cmake .. -GNinja +ninja && sudo ninja install +``` + +Check that GLOMAP is successfully installed: + +``` +glomap -h +``` + ## Polycam Capture Nerfstudio can also be trained directly from captures from the [Polycam app](https://poly.cam//). This avoids the need to use COLMAP. Polycam's poses are globally optimized which make them more robust to drift (an issue with ARKit or SLAM methods). From 0a414fb2a8e2362dcd45ec967e0cda020adb3ce9 Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Fri, 6 Sep 2024 01:46:43 -0700 Subject: [PATCH 07/14] finished glomap ruff and pyright and formating and linting and YAWN --- nerfstudio/process_data/colmap_utils.py | 2 +- nerfstudio/process_data/process_data_utils.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nerfstudio/process_data/colmap_utils.py b/nerfstudio/process_data/colmap_utils.py index 189c141780..91fba59413 100644 --- a/nerfstudio/process_data/colmap_utils.py +++ b/nerfstudio/process_data/colmap_utils.py @@ -160,7 +160,7 @@ def run_colmap( f"--image_path {image_dir}", f"--output_path {sparse_dir}", ] - if colmap_version >= Version("3.7") and glomap_toggle != True: + if colmap_version >= Version("3.7") and not glomap_toggle: mapper_cmd.append("--Mapper.ba_global_function_tolerance=1e-6") mapper_cmd = " ".join(mapper_cmd) diff --git a/nerfstudio/process_data/process_data_utils.py b/nerfstudio/process_data/process_data_utils.py index 5cdb20c578..83edafd464 100644 --- a/nerfstudio/process_data/process_data_utils.py +++ b/nerfstudio/process_data/process_data_utils.py @@ -510,7 +510,7 @@ def find_tool_feature_matcher_combination( ) -> Union[ Tuple[None, None, None], Tuple[ - Literal["colmap", "hloc"], + Literal["colmap", "glomap", "hloc"], Literal[ "sift", "superpoint_aachen", @@ -556,12 +556,12 @@ def find_tool_feature_matcher_combination( if (feature_type not in ("any", "sift")) or (matcher_type not in ("any", "NN")): return (None, None, None) return ("colmap", "sift", "NN") - + if sfm_tool == "glomap": if (feature_type not in ("any", "sift")) or (matcher_type not in ("any", "NN")): return (None, None, None) return ("glomap", "sift", "NN") - + if sfm_tool == "hloc": if feature_type in ("any", "superpoint"): feature_type = "superpoint_aachen" From 6fde483cf9ff5fadda01eda6a74f86bd0e4ae92a Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Sat, 7 Sep 2024 01:57:14 -0700 Subject: [PATCH 08/14] new changes --- .vscode/settings.json | 126 ------------------ nerfstudio/process_data/colmap_utils.py | 5 +- .../video_to_nerfstudio_dataset.py | 1 - 3 files changed, 3 insertions(+), 129 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index c365ae07b4..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "files.watcherExclude": { - "**/__pycache__/": true, - "**/.ipynb_checkpoints": true, - "**/*.ipynb": true, - "**/old*": true, - "**/runs*": true, - "**/temp*": true - }, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[javascriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[typescriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "prettier.configPath": ".prettierrc.js", - "typescript.suggestionActions.enabled": false, - "javascript.suggestionActions.enabled": false, - "[python]": { - "editor.defaultFormatter": "charliermarsh.ruff", - "editor.codeActionsOnSave": { - "source.organizeImports": "explicit", - "source.fixAll": "explicit" - } - }, - "editor.formatOnSave": true, - "editor.rulers": [120], - "python.envFile": "${workspaceFolder}/.env", - "python.formatting.provider": "none", - "python.linting.pylintEnabled": false, - "python.linting.flake8Enabled": false, - "python.linting.enabled": true, - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, - "python.linting.ignorePatterns": [ - "**/site-packages/**/*.py", - ".vscode/*.py", - "external/**/*.py" - ], - "esbonio.sphinx.confDir": "", - // eslint extension options - "javascript.validate.enable": false, - "eslint.enable": true, - "eslint.validate": [ - "javascript", - "javascriptreact", - "typescript", - "typescriptreact" - ], - "C_Cpp.errorSquiggles": "Disabled", - "files.associations": { - "array": "cpp", - "bitset": "cpp", - "string_view": "cpp", - "initializer_list": "cpp", - "utility": "cpp", - "__hash_table": "cpp", - "__split_buffer": "cpp", - "deque": "cpp", - "iterator": "cpp", - "queue": "cpp", - "stack": "cpp", - "string": "cpp", - "unordered_map": "cpp", - "vector": "cpp", - "atomic": "cpp", - "*.tcc": "cpp", - "cctype": "cpp", - "chrono": "cpp", - "clocale": "cpp", - "cmath": "cpp", - "codecvt": "cpp", - "condition_variable": "cpp", - "cstdarg": "cpp", - "cstddef": "cpp", - "cstdint": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "cstring": "cpp", - "ctime": "cpp", - "cwchar": "cpp", - "cwctype": "cpp", - "exception": "cpp", - "algorithm": "cpp", - "filesystem": "cpp", - "functional": "cpp", - "memory": "cpp", - "memory_resource": "cpp", - "optional": "cpp", - "ratio": "cpp", - "system_error": "cpp", - "tuple": "cpp", - "type_traits": "cpp", - "fstream": "cpp", - "iomanip": "cpp", - "iosfwd": "cpp", - "iostream": "cpp", - "istream": "cpp", - "limits": "cpp", - "mutex": "cpp", - "new": "cpp", - "ostream": "cpp", - "sstream": "cpp", - "stdexcept": "cpp", - "streambuf": "cpp", - "thread": "cpp", - "typeinfo": "cpp", - "__nullptr": "cpp", - "__config": "cpp", - "__locale": "cpp", - "__bit_reference": "cpp", - "ios": "cpp", - "__atomic": "cpp", - "__node_handle": "cpp" - }, - "python.analysis.typeCheckingMode": "basic", - "python.analysis.diagnosticMode": "workspace", - "eslint.packageManager": "yarn", -} diff --git a/nerfstudio/process_data/colmap_utils.py b/nerfstudio/process_data/colmap_utils.py index 91fba59413..9249bc88fc 100644 --- a/nerfstudio/process_data/colmap_utils.py +++ b/nerfstudio/process_data/colmap_utils.py @@ -162,7 +162,8 @@ def run_colmap( ] if colmap_version >= Version("3.7") and not glomap_toggle: mapper_cmd.append("--Mapper.ba_global_function_tolerance=1e-6") - + if glomap_toggle: + mapper_cmd.append("--TrackEstablishment.max_num_tracks 5000") mapper_cmd = " ".join(mapper_cmd) with status( @@ -413,7 +414,7 @@ def colmap_to_json( Returns: The number of registered images. """ - + breakpoint() # TODO(1480) use pycolmap # recon = pycolmap.Reconstruction(recon_dir) # cam_id_to_camera = recon.cameras diff --git a/nerfstudio/process_data/video_to_nerfstudio_dataset.py b/nerfstudio/process_data/video_to_nerfstudio_dataset.py index af17e7d6b6..fefa0be89c 100644 --- a/nerfstudio/process_data/video_to_nerfstudio_dataset.py +++ b/nerfstudio/process_data/video_to_nerfstudio_dataset.py @@ -128,7 +128,6 @@ def main(self) -> None: ) if mask_path is not None: summary_log.append(f"Saved mask to {mask_path}") - # Run Colmap if not self.skip_colmap: self._run_colmap(mask_path) From 856d5789c9b7d58039e6065cdc4181f8089b1d39 Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Sat, 7 Sep 2024 01:58:10 -0700 Subject: [PATCH 09/14] adding .vscode file back --- .vscode/settings.json | 127 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..b857bdf9e6 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,127 @@ +{ + "files.watcherExclude": { + "**/__pycache__/": true, + "**/.ipynb_checkpoints": true, + "**/*.ipynb": true, + "**/old*": true, + "**/runs*": true, + "**/temp*": true + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "prettier.configPath": ".prettierrc.js", + "typescript.suggestionActions.enabled": false, + "javascript.suggestionActions.enabled": false, + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit", + "source.fixAll": "explicit" + } + }, + "editor.formatOnSave": true, + "editor.rulers": [120], + "python.envFile": "${workspaceFolder}/.env", + "python.formatting.provider": "none", + "python.linting.pylintEnabled": false, + "python.linting.flake8Enabled": false, + "python.linting.enabled": true, + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "python.linting.ignorePatterns": [ + "**/site-packages/**/*.py", + ".vscode/*.py", + "external/**/*.py" + ], + "esbonio.sphinx.confDir": "", + // eslint extension options + "javascript.validate.enable": false, + "eslint.enable": true, + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact" + ], + "C_Cpp.errorSquiggles": "Disabled", + "files.associations": { + "array": "cpp", + "bitset": "cpp", + "string_view": "cpp", + "initializer_list": "cpp", + "utility": "cpp", + "__hash_table": "cpp", + "__split_buffer": "cpp", + "deque": "cpp", + "iterator": "cpp", + "queue": "cpp", + "stack": "cpp", + "string": "cpp", + "unordered_map": "cpp", + "vector": "cpp", + "atomic": "cpp", + "*.tcc": "cpp", + "cctype": "cpp", + "chrono": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "codecvt": "cpp", + "condition_variable": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "filesystem": "cpp", + "functional": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "optional": "cpp", + "ratio": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "fstream": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "ostream": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "typeinfo": "cpp", + "__nullptr": "cpp", + "__config": "cpp", + "__locale": "cpp", + "__bit_reference": "cpp", + "ios": "cpp", + "__atomic": "cpp", + "__node_handle": "cpp" + }, + "python.analysis.typeCheckingMode": "basic", + "python.analysis.diagnosticMode": "workspace", + "eslint.packageManager": "yarn", + "git.ignoreLimitWarning": true, +} From 3a1014d205723f4fc53f256007e727d751285ea8 Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Sat, 7 Sep 2024 01:58:52 -0700 Subject: [PATCH 10/14] restoring vscode to original state --- .vscode/settings.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b857bdf9e6..c365ae07b4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -123,5 +123,4 @@ "python.analysis.typeCheckingMode": "basic", "python.analysis.diagnosticMode": "workspace", "eslint.packageManager": "yarn", - "git.ignoreLimitWarning": true, } From 163d8902304c045b0cd95fb41558fb7e44cb56b2 Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Mon, 9 Sep 2024 16:10:47 -0700 Subject: [PATCH 11/14] updating loading and finishing messages to say GLOMAP when GLOMAP is on --- nerfstudio/process_data/colmap_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nerfstudio/process_data/colmap_utils.py b/nerfstudio/process_data/colmap_utils.py index 9249bc88fc..4ecc51a848 100644 --- a/nerfstudio/process_data/colmap_utils.py +++ b/nerfstudio/process_data/colmap_utils.py @@ -167,12 +167,12 @@ def run_colmap( mapper_cmd = " ".join(mapper_cmd) with status( - msg="[bold yellow]Running COLMAP bundle adjustment... (This may take a while)", + msg=f"[bold yellow]Running {'GLOMAP' if glomap_toggle else 'COLMAP'} bundle adjustment... (This may take a while)", spinner="circle", verbose=verbose, ): run_command(mapper_cmd, verbose=verbose) - CONSOLE.log("[bold green]:tada: Done COLMAP bundle adjustment.") + CONSOLE.log("[bold green]:tada: Done {'GLOMAP' if glomap_toggle else 'COLMAP'} bundle adjustment.") if refine_intrinsics: with status(msg="[bold yellow]Refine intrinsics...", spinner="dqpb", verbose=verbose): From 40823367097b2ccb1bb9536f8f5f19f948bcb69c Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Mon, 9 Sep 2024 20:52:07 -0700 Subject: [PATCH 12/14] fixing loading messages --- nerfstudio/process_data/colmap_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nerfstudio/process_data/colmap_utils.py b/nerfstudio/process_data/colmap_utils.py index 4ecc51a848..233ce07897 100644 --- a/nerfstudio/process_data/colmap_utils.py +++ b/nerfstudio/process_data/colmap_utils.py @@ -167,12 +167,12 @@ def run_colmap( mapper_cmd = " ".join(mapper_cmd) with status( - msg=f"[bold yellow]Running {'GLOMAP' if glomap_toggle else 'COLMAP'} bundle adjustment... (This may take a while)", + msg=f"[bold yellow]Running GLOMAP bundle adjustment..." if glomap_toggle else "[bold yellow]Running COLMAP bundle adjustment... (This may take a while)" , spinner="circle", verbose=verbose, ): run_command(mapper_cmd, verbose=verbose) - CONSOLE.log("[bold green]:tada: Done {'GLOMAP' if glomap_toggle else 'COLMAP'} bundle adjustment.") + CONSOLE.log(f"[bold green]:tada: Done {'GLOMAP' if glomap_toggle else 'COLMAP'} bundle adjustment.") if refine_intrinsics: with status(msg="[bold yellow]Refine intrinsics...", spinner="dqpb", verbose=verbose): From 1235859c3a6978cc594fdb17965074cdb3e55b5f Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Mon, 9 Sep 2024 21:43:49 -0700 Subject: [PATCH 13/14] ran ruff and pyright --- nerfstudio/process_data/colmap_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nerfstudio/process_data/colmap_utils.py b/nerfstudio/process_data/colmap_utils.py index 233ce07897..619580b4a3 100644 --- a/nerfstudio/process_data/colmap_utils.py +++ b/nerfstudio/process_data/colmap_utils.py @@ -167,7 +167,9 @@ def run_colmap( mapper_cmd = " ".join(mapper_cmd) with status( - msg=f"[bold yellow]Running GLOMAP bundle adjustment..." if glomap_toggle else "[bold yellow]Running COLMAP bundle adjustment... (This may take a while)" , + msg="[bold yellow]Running GLOMAP bundle adjustment..." + if glomap_toggle + else "[bold yellow]Running COLMAP bundle adjustment... (This may take a while)", spinner="circle", verbose=verbose, ): @@ -414,7 +416,7 @@ def colmap_to_json( Returns: The number of registered images. """ - breakpoint() + # TODO(1480) use pycolmap # recon = pycolmap.Reconstruction(recon_dir) # cam_id_to_camera = recon.cameras From 1a1efae2ae0901e44911a2350805c9e2ba9677ab Mon Sep 17 00:00:00 2001 From: AntonioMacaronio Date: Mon, 9 Sep 2024 21:45:17 -0700 Subject: [PATCH 14/14] quick fix --- nerfstudio/process_data/video_to_nerfstudio_dataset.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nerfstudio/process_data/video_to_nerfstudio_dataset.py b/nerfstudio/process_data/video_to_nerfstudio_dataset.py index fefa0be89c..af17e7d6b6 100644 --- a/nerfstudio/process_data/video_to_nerfstudio_dataset.py +++ b/nerfstudio/process_data/video_to_nerfstudio_dataset.py @@ -128,6 +128,7 @@ def main(self) -> None: ) if mask_path is not None: summary_log.append(f"Saved mask to {mask_path}") + # Run Colmap if not self.skip_colmap: self._run_colmap(mask_path)