diff --git a/nerfstudio/models/splatfacto.py b/nerfstudio/models/splatfacto.py index 90bdccd70d..071a063e3f 100644 --- a/nerfstudio/models/splatfacto.py +++ b/nerfstudio/models/splatfacto.py @@ -747,10 +747,14 @@ def get_outputs(self, camera: Cameras) -> Dict[str, Union[torch.Tensor, List]]: tile_bounds, ) # type: ignore + # rescale the camera back to original dimensions before returning + camera.rescale_output_resolution(camera_downscale) + if (self.radii).sum() == 0: - rgb = background.repeat(int(camera.height.item()), int(camera.width.item()), 1) + rgb = background.repeat(H, W, 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, "background": background} # Important to allow xys grads to populate properly @@ -766,8 +770,6 @@ def get_outputs(self, camera: Cameras) -> Dict[str, Union[torch.Tensor, List]]: else: rgbs = torch.sigmoid(colors_crop[:, 0, :]) - # rescale the camera back to original dimensions - camera.rescale_output_resolution(camera_downscale) assert (num_tiles_hit > 0).any() # type: ignore # apply the compensation of screen space blurring to gaussians