From b4f0c5e848bd5332ff03e5fac0738093cdf49ded Mon Sep 17 00:00:00 2001 From: AdamRashid96 Date: Mon, 7 Aug 2023 20:40:20 +0000 Subject: [PATCH] fixed bug to now use true depth loss when true depth is available --- nerfstudio/data/datasets/depth_dataset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nerfstudio/data/datasets/depth_dataset.py b/nerfstudio/data/datasets/depth_dataset.py index 85d20ce7c..848d1368c 100644 --- a/nerfstudio/data/datasets/depth_dataset.py +++ b/nerfstudio/data/datasets/depth_dataset.py @@ -51,7 +51,6 @@ class DepthDataset(InputDataset): or dataparser_outputs.metadata["depth_filenames"] is None ): losses.DEPTH_METRIC = 0 - CONSOLE.print("[bold yellow] No depth data found!") cache = dataparser_outputs.image_filenames[0].parent / "depths.npy" if cache.exists(): CONSOLE.print("[bold yellow] Loading cache!") @@ -59,6 +58,7 @@ class DepthDataset(InputDataset): self.depths = np.load(cache) self.depths = torch.from_numpy(self.depths).to(device) else: + CONSOLE.print("[bold yellow] No depth data found!") depth_tensors = [] transforms = self._find_transform(dataparser_outputs.image_filenames[0]) data = dataparser_outputs.image_filenames[0].parent @@ -98,7 +98,7 @@ class DepthDataset(InputDataset): self.metadata["depth_unit_scale_factor"] = 1.0 else: - losses.DEPTH_METRIC = 0 + losses.DEPTH_METRIC = 1 self.depth_filenames = self.metadata["depth_filenames"] self.depth_unit_scale_factor = self.metadata["depth_unit_scale_factor"]