From 7e8d67f8a871a2d8cdca7378b2e6f66eade8ce56 Mon Sep 17 00:00:00 2001 From: Sasha Sax Date: Tue, 1 Aug 2023 09:03:01 -0700 Subject: [PATCH] Add depth_unit_scale_factor to sdfstudio_dataparser (#2285) Depth supervision for `depth-nerfacto` was added in #1173. This patch extends that support to `sdfstudio` datasets ([as originally intended](https://github.com/nerfstudio-project/nerfstudio/issues/1173#issuecomment-1494633338_)) by adding `depth_unit_scale_factor` to `sdfstudio` metadata. --- nerfstudio/data/dataparsers/sdfstudio_dataparser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nerfstudio/data/dataparsers/sdfstudio_dataparser.py b/nerfstudio/data/dataparsers/sdfstudio_dataparser.py index 85684aeb83..430a8aca8b 100644 --- a/nerfstudio/data/dataparsers/sdfstudio_dataparser.py +++ b/nerfstudio/data/dataparsers/sdfstudio_dataparser.py @@ -42,6 +42,8 @@ class SDFStudioDataParserConfig(DataParserConfig): """Directory specifying location of data.""" include_mono_prior: bool = False """whether or not to load monocular depth and normal """ + depth_unit_scale_factor: float = 1e-3 + """Scales the depth values to meters. Default value is 0.001 for a millimeter to meter conversion.""" include_foreground_mask: bool = False """whether or not to load foreground mask""" downscale_factor: int = 1 @@ -153,6 +155,7 @@ def _generate_dataparser_outputs(self, split="train"): # required for normal maps, these are in colmap format so they require c2w before conversion "camera_to_worlds": c2w_colmap if len(c2w_colmap) > 0 else None, "include_mono_prior": self.config.include_mono_prior, + "depth_unit_scale_factor": self.config.depth_unit_scale_factor, }, ) return dataparser_outputs