From cecad3c8ceeaed7a7b3a1d8f99ee0e60a41964fd Mon Sep 17 00:00:00 2001 From: Justin Kerr Date: Tue, 15 Aug 2023 12:17:09 -0700 Subject: [PATCH] properly save masks in the images processing pipeline --- .../images_to_nerfstudio_dataset.py | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/nerfstudio/process_data/images_to_nerfstudio_dataset.py b/nerfstudio/process_data/images_to_nerfstudio_dataset.py index 7ae7d5bd4..9ad2c1068 100644 --- a/nerfstudio/process_data/images_to_nerfstudio_dataset.py +++ b/nerfstudio/process_data/images_to_nerfstudio_dataset.py @@ -91,20 +91,20 @@ class ImagesToNerfstudioDataset(ColmapConverterToNerfstudioDataset): num_frames = len(image_rename_map) summary_log.append(f"Starting with {num_frames} images") - # # Create mask - mask_path = process_data_utils.save_mask( - image_dir=self.image_dir, - num_downscales=self.num_downscales, - crop_factor=(0.0, 0.0, 0.0, 0.0), - percent_radius=self.percent_radius_crop, - ) - if mask_path is not None: - summary_log.append("Saved mask(s)") else: num_frames = len(process_data_utils.list_images(self.data)) if num_frames == 0: raise RuntimeError("No usable images in the data folder.") summary_log.append(f"Starting with {num_frames} images") + # # Create mask + mask_path = process_data_utils.save_mask( + image_dir=self.image_dir, + num_downscales=self.num_downscales, + crop_factor=(0.0, 0.0, 0.0, 0.0), + percent_radius=self.percent_radius_crop, + ) + if mask_path is not None: + summary_log.append("Saved mask(s)") # Run COLMAP if not self.skip_colmap: @@ -120,12 +120,7 @@ class ImagesToNerfstudioDataset(ColmapConverterToNerfstudioDataset): if require_cameras_exist and not (self.absolute_colmap_model_path / "cameras.bin").exists(): raise RuntimeError(f"Could not find existing COLMAP results ({self.colmap_model_path / 'cameras.bin'}).") - summary_log += self._save_transforms( - num_frames, - image_id_to_depth_path, - None, - image_rename_map, - ) + summary_log += self._save_transforms(num_frames, image_id_to_depth_path, mask_path, image_rename_map) CONSOLE.log("[bold green]:tada: :tada: :tada: All DONE :tada: :tada: :tada:")