mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-03 22:38:48 +08:00
Enable always returning depth for Gaussian Splatting (#2873)
enable always returning depth, if specified in the config
This commit is contained in:
1 parent
52cda21186
commit
af2072bf7c
1 file changed
+3
-1
@@ -155,6 +155,8 @@ class SplatfactoModelConfig(ModelConfig):
|
|||||||
"""threshold of ratio of gaussian max to min scale before applying regularization
|
"""threshold of ratio of gaussian max to min scale before applying regularization
|
||||||
loss from the PhysGaussian paper
|
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):
|
class SplatfactoModel(Model):
|
||||||
@@ -766,7 +768,7 @@ class SplatfactoModel(Model):
|
|||||||
alpha = alpha[..., None]
|
alpha = alpha[..., None]
|
||||||
rgb = torch.clamp(rgb, max=1.0) # type: ignore
|
rgb = torch.clamp(rgb, max=1.0) # type: ignore
|
||||||
depth_im = None
|
depth_im = None
|
||||||
if not self.training:
|
if self.config.output_depth_during_training or not self.training:
|
||||||
depth_im = rasterize_gaussians( # type: ignore
|
depth_im = rasterize_gaussians( # type: ignore
|
||||||
self.xys,
|
self.xys,
|
||||||
depths,
|
depths,
|
||||||
|
|||||||
Reference in new issue
Block a user