Skip to content

Commit

Permalink
Handle COLMAP sparse reconstruction when there was more than one run
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantysz authored Jun 20, 2024
1 parent 9b3cbc7 commit 114072c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nerfstudio/data/dataparsers/nerfstudio_dataparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,12 @@ def _generate_dataparser_outputs(self, split="train"):
# - dataparser_transform_matrix contains the transformation to dataparser output coordinates from original data coordinates.
# - applied_transform contains the transformation to saved coordinates from original data coordinates.
applied_transform = None
colmap_path = self.config.data / "colmap/sparse/0"

sparse_path = self.config.data / "colmap/sparse"
all_sparse_runs = [int(f.name) for f in sparse_path.iterdir() if f.is_dir()]
latest_run_number = max(all_sparse_runs)
colmap_path = sparse_path / str(latest_run_number)

if "applied_transform" in meta:
applied_transform = torch.tensor(meta["applied_transform"], dtype=transform_matrix.dtype)
elif colmap_path.exists():
Expand Down

0 comments on commit 114072c

Please sign in to comment.