Call rescale_output_resolution before early return (#2897)

* Call rescale_output_resolution before early return

Co-authored-by: Chung Min Kim <chungmin99@gmail.com>
This commit is contained in:
Piero ToffaninandChung Min Kim authored and GitHub committed 2024-02-13 23:12:18 +00:00
1 parent 7f9def1ff0
commit 45db2bcfab
1 file changed
+5 -3
+5 -3
View File
@@ -747,10 +747,14 @@ class SplatfactoModel(Model):
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 @@ class SplatfactoModel(Model):
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