Skip to content

Commit

Permalink
Add depth_unit_scale_factor to sdfstudio_dataparser (#2285)
Browse files Browse the repository at this point in the history
Depth supervision for `depth-nerfacto` was added in #1173. This patch extends that support to `sdfstudio` datasets ([as originally intended](#1173 (comment))) by adding `depth_unit_scale_factor` to `sdfstudio` metadata.
  • Loading branch information
alexsax authored Aug 1, 2023
1 parent e6cd951 commit 7e8d67f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nerfstudio/data/dataparsers/sdfstudio_dataparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 7e8d67f

Please sign in to comment.