From 625ffb719bb64160780de48b490ee3e1e1685aa6 Mon Sep 17 00:00:00 2001 From: Ethan Weber Date: Tue, 6 Feb 2024 00:25:04 +0000 Subject: [PATCH] enable always returning depth, if specified in the config --- nerfstudio/models/splatfacto.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nerfstudio/models/splatfacto.py b/nerfstudio/models/splatfacto.py index b23eabe002..6733db406b 100644 --- a/nerfstudio/models/splatfacto.py +++ b/nerfstudio/models/splatfacto.py @@ -155,6 +155,8 @@ class SplatfactoModelConfig(ModelConfig): """threshold of ratio of gaussian max to min scale before applying regularization loss from the PhysGaussian paper """ + output_depth_during_training: bool = False + """If True, output depth during training. Otherwise, only output depth during evaluation.""" class SplatfactoModel(Model): @@ -766,7 +768,7 @@ def get_outputs(self, camera: Cameras) -> Dict[str, Union[torch.Tensor, List]]: alpha = alpha[..., None] rgb = torch.clamp(rgb, max=1.0) # type: ignore depth_im = None - if not self.training: + if self.config.output_depth_during_training or not self.training: depth_im = rasterize_gaussians( # type: ignore self.xys, depths,