Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle COLMAP sparse reconstruction when there was more than one run #3246

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading