Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call rescale_output_resolution before early return #2897

Merged
merged 6 commits into from
Feb 13, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 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)
chungmin99 marked this conversation as resolved.
Show resolved Hide resolved

if (self.radii).sum() == 0:
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, "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
Loading