From b747db68774d528e63c46bfc57e6f55249946290 Mon Sep 17 00:00:00 2001 From: Khoa Nguyen-Tuan <12138158+Khoa-NT@users.noreply.github.com> Date: Thu, 22 Jun 2023 01:24:55 +0900 Subject: [PATCH] Fixing the image_dir if using skip_image_processing (#2111) Co-authored-by: khoa Co-authored-by: Matthew Tancik --- .../colmap_converter_to_nerfstudio_dataset.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py b/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py index b80923d3e..fb2fb88b6 100644 --- a/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py +++ b/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py @@ -189,9 +189,15 @@ class ColmapConverterToNerfstudioDataset(BaseConverterToNerfstudioDataset): if self.refine_pixsfm: assert sfm_tool == "hloc", "refine_pixsfm only works with sfm_tool hloc" + # set the image_dir if didn't copy + if self.skip_image_processing: + image_dir = self.data + else: + image_dir = self.image_dir + if sfm_tool == "colmap": colmap_utils.run_colmap( - image_dir=self.image_dir, + image_dir=image_dir, colmap_dir=self.absolute_colmap_path, camera_model=CAMERA_MODELS[self.camera_type], camera_mask_path=mask_path, @@ -208,7 +214,7 @@ class ColmapConverterToNerfstudioDataset(BaseConverterToNerfstudioDataset): assert matcher_type is not None assert matcher_type != "NN" # Only used for colmap. hloc_utils.run_hloc( - image_dir=self.image_dir, + image_dir=image_dir, colmap_dir=self.absolute_colmap_path, camera_model=CAMERA_MODELS[self.camera_type], verbose=self.verbose,