Skip to content

Commit

Permalink
Add depth_unit_scale_factor to sdfstudio_dataparser
Browse files Browse the repository at this point in the history
Depth supervision for `depth-nerfacto` was added in nerfstudio-project#1173. This patch extends that support to `sdfstudio` datasets ([as originally intended](nerfstudio-project#1173 (comment))) by adding `depth_unit_scale_factor` to `sdfstudio` metadata.
  • Loading branch information
alexsax authored Aug 1, 2023
1 parent e6cd951 commit 1312c39
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 1312c39

Please sign in to comment.