Skip to content

Commit ed2e3d4

Browse files
ethanweberArpegorPSGH
authored andcommitted
Enable always returning depth for Gaussian Splatting (nerfstudio-project#2873)
enable always returning depth, if specified in the config
1 parent 9f8a42f commit ed2e3d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nerfstudio/models/splatfacto.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ class SplatfactoModelConfig(ModelConfig):
155155
"""threshold of ratio of gaussian max to min scale before applying regularization
156156
loss from the PhysGaussian paper
157157
"""
158+
output_depth_during_training: bool = False
159+
"""If True, output depth during training. Otherwise, only output depth during evaluation."""
158160

159161

160162
class SplatfactoModel(Model):
@@ -766,7 +768,7 @@ def get_outputs(self, camera: Cameras) -> Dict[str, Union[torch.Tensor, List]]:
766768
alpha = alpha[..., None]
767769
rgb = torch.clamp(rgb, max=1.0) # type: ignore
768770
depth_im = None
769-
if not self.training:
771+
if self.config.output_depth_during_training or not self.training:
770772
depth_im = rasterize_gaussians( # type: ignore
771773
self.xys,
772774
depths,

0 commit comments

Comments
 (0)