Skip to content

Commit

Permalink
Call rescale_output_resolution before early return (nerfstudio-projec…
Browse files Browse the repository at this point in the history
…t#2897)

* Call rescale_output_resolution before early return

Co-authored-by: Chung Min Kim <[email protected]>
  • Loading branch information
2 people authored and ArpegorPSGH committed Jun 22, 2024
1 parent 79341b2 commit f205475
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nerfstudio/models/splatfacto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f205475

Please sign in to comment.