Skip to content

Commit 45db2bc

Browse files
Call rescale_output_resolution before early return (#2897)
* Call rescale_output_resolution before early return Co-authored-by: Chung Min Kim <[email protected]>
1 parent 7f9def1 commit 45db2bc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nerfstudio/models/splatfacto.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -747,10 +747,14 @@ def get_outputs(self, camera: Cameras) -> Dict[str, Union[torch.Tensor, List]]:
747747
tile_bounds,
748748
) # type: ignore
749749

750+
# rescale the camera back to original dimensions before returning
751+
camera.rescale_output_resolution(camera_downscale)
752+
750753
if (self.radii).sum() == 0:
751-
rgb = background.repeat(int(camera.height.item()), int(camera.width.item()), 1)
754+
rgb = background.repeat(H, W, 1)
752755
depth = background.new_ones(*rgb.shape[:2], 1) * 10
753756
accumulation = background.new_zeros(*rgb.shape[:2], 1)
757+
754758
return {"rgb": rgb, "depth": depth, "accumulation": accumulation, "background": background}
755759

756760
# Important to allow xys grads to populate properly
@@ -766,8 +770,6 @@ def get_outputs(self, camera: Cameras) -> Dict[str, Union[torch.Tensor, List]]:
766770
else:
767771
rgbs = torch.sigmoid(colors_crop[:, 0, :])
768772

769-
# rescale the camera back to original dimensions
770-
camera.rescale_output_resolution(camera_downscale)
771773
assert (num_tiles_hit > 0).any() # type: ignore
772774

773775
# apply the compensation of screen space blurring to gaussians

0 commit comments

Comments
 (0)