mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-01 13:28:59 +08:00
fixed bug to now use true depth loss when true depth is available
This commit is contained in:
1 parent
4ceae420a6
commit
b4f0c5e848
1 file changed
+2
-2
@@ -51,7 +51,6 @@ class DepthDataset(InputDataset):
|
|||||||
or dataparser_outputs.metadata["depth_filenames"] is None
|
or dataparser_outputs.metadata["depth_filenames"] is None
|
||||||
):
|
):
|
||||||
losses.DEPTH_METRIC = 0
|
losses.DEPTH_METRIC = 0
|
||||||
CONSOLE.print("[bold yellow] No depth data found!")
|
|
||||||
cache = dataparser_outputs.image_filenames[0].parent / "depths.npy"
|
cache = dataparser_outputs.image_filenames[0].parent / "depths.npy"
|
||||||
if cache.exists():
|
if cache.exists():
|
||||||
CONSOLE.print("[bold yellow] Loading cache!")
|
CONSOLE.print("[bold yellow] Loading cache!")
|
||||||
@@ -59,6 +58,7 @@ class DepthDataset(InputDataset):
|
|||||||
self.depths = np.load(cache)
|
self.depths = np.load(cache)
|
||||||
self.depths = torch.from_numpy(self.depths).to(device)
|
self.depths = torch.from_numpy(self.depths).to(device)
|
||||||
else:
|
else:
|
||||||
|
CONSOLE.print("[bold yellow] No depth data found!")
|
||||||
depth_tensors = []
|
depth_tensors = []
|
||||||
transforms = self._find_transform(dataparser_outputs.image_filenames[0])
|
transforms = self._find_transform(dataparser_outputs.image_filenames[0])
|
||||||
data = dataparser_outputs.image_filenames[0].parent
|
data = dataparser_outputs.image_filenames[0].parent
|
||||||
@@ -98,7 +98,7 @@ class DepthDataset(InputDataset):
|
|||||||
self.metadata["depth_unit_scale_factor"] = 1.0
|
self.metadata["depth_unit_scale_factor"] = 1.0
|
||||||
|
|
||||||
else:
|
else:
|
||||||
losses.DEPTH_METRIC = 0
|
losses.DEPTH_METRIC = 1
|
||||||
|
|
||||||
self.depth_filenames = self.metadata["depth_filenames"]
|
self.depth_filenames = self.metadata["depth_filenames"]
|
||||||
self.depth_unit_scale_factor = self.metadata["depth_unit_scale_factor"]
|
self.depth_unit_scale_factor = self.metadata["depth_unit_scale_factor"]
|
||||||
|
|||||||
Reference in new issue
Block a user