Merge branch 'main' into justin/gsplat_bump

This commit is contained in:
Justin Kerr authored and GitHub committed 2024-02-06 18:56:29 -08:00
commit df1a5a70e4
3 files changed
+17 -5

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
<p align="center"> <p align="center">
<!-- community badges --> <!-- community badges -->
<a href="https://discord.gg/uMbNqcraFc"><img src="https://img.shields.io/badge/Join-Discord-blue.svg"/></a> <a href="https://discord.gg/uMbNqcraFc"><img src="https://dcbadge.vercel.app/api/server/uMbNqcraFc?style=plastic"/></a>
<!-- doc badges --> <!-- doc badges -->
<a href='https://docs.nerf.studio/'> <a href='https://docs.nerf.studio/'>
<img src='https://readthedocs.com/projects/plenoptix-nerfstudio/badge/?version=latest' alt='Documentation Status' /></a> <img src='https://readthedocs.com/projects/plenoptix-nerfstudio/badge/?version=latest' alt='Documentation Status' /></a>
+5 -1
View File
@@ -1,4 +1,8 @@
# Local Server # (Legacy Viewer) Local Server
**Note:** this doc only applies to the legacy version of the viewer, which was the default in in Nerfstudio versions `<=0.3.4`. It was deprecated starting Nerfstudio version `1.0.0`, where it needs to be opted into via the `--vis viewer_legacy` argument.
---
If you are unable to connect to `https://viewer.nerf.studio`, want to use Safari, or want to develop the viewer codebase, you can launch your own local viewer. If you are unable to connect to `https://viewer.nerf.studio`, want to use Safari, or want to develop the viewer codebase, you can launch your own local viewer.
+11 -3
View File
@@ -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):
@@ -667,7 +669,10 @@ class SplatfactoModel(Model):
if self.crop_box is not None and not self.training: if self.crop_box is not None and not self.training:
crop_ids = self.crop_box.within(self.means).squeeze() crop_ids = self.crop_box.within(self.means).squeeze()
if crop_ids.sum() == 0: if crop_ids.sum() == 0:
return {"rgb": background.repeat(int(camera.height.item()), int(camera.width.item()), 1)} rgb = background.repeat(int(camera.height.item()), int(camera.width.item()), 1)
depth = background.new_ones(*rgb.shape[:2], 1) * 10
accumulation = background.new_zeros(*rgb.shape[:2], 1)
return {"rgb": rgb, "depth": depth, "accumulation": accumulation}
else: else:
crop_ids = None crop_ids = None
camera_downscale = self._get_downscale_factor() camera_downscale = self._get_downscale_factor()
@@ -732,7 +737,10 @@ class SplatfactoModel(Model):
tile_bounds, tile_bounds,
) # type: ignore ) # type: ignore
if (self.radii).sum() == 0: if (self.radii).sum() == 0:
return {"rgb": background.repeat(int(camera.height.item()), int(camera.width.item()), 1)} rgb = background.repeat(int(camera.height.item()), int(camera.width.item()), 1)
depth = background.new_ones(*rgb.shape[:2], 1) * 10
accumulation = background.new_zeros(*rgb.shape[:2], 1)
return {"rgb": rgb, "depth": depth, "accumulation": accumulation}
# Important to allow xys grads to populate properly # Important to allow xys grads to populate properly
if self.training: if self.training:
@@ -766,7 +774,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,