4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 02:24:38 +08:00

fixed bug to now use true depth loss when true depth is available

This commit is contained in:
AdamRashid96 2023-08-07 20:40:20 +00:00
parent 4ceae420a6
commit b4f0c5e848

View File

@ -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"]