Skip to content

Commit

Permalink
Merge pull request #2 from vaibhavnayel/main
Browse files Browse the repository at this point in the history
Fix shape mismatch on scenes other than garden
  • Loading branch information
WangFeng18 authored Jun 25, 2023
2 parents 05ef8a9 + 4d3a838 commit fd52a68
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions splatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ def crop(self, image):
# output: height x width x 3
top = int(self.padded_height - self.height)//2
left = int(self.padded_width - self.width)//2
#return image[top:top+int(self.height), left:left+int(self.width), :]
return image[top:top+int(self.height)-1, left:left+int(self.width), :]
return image[top:top+int(self.height), left:left+int(self.width), :]

def create_tiles(self):
self.tiles_left = torch.linspace(-self.padded_width/2, self.padded_width/2, self.n_tile_x + 1, device=self.device)[:-1]
Expand Down Expand Up @@ -490,7 +489,7 @@ def set_camera(self, idx, extrinsics=None, intrinsics=None):
focal_y = self.current_camera.params[1] / self.render_downsample
print(focal_x)
print(focal_y)
self.tile_info = Tiles(math.ceil(width), math.ceil(height), focal_x, focal_y, self.device)
self.tile_info = Tiles(int(self.ground_truth.shape[1]), int(self.ground_truth.shape[0]), focal_x, focal_y, self.device)
self.tile_info_cpp = self.tile_info.create_tiles()

self.ray_info = RayInfo(
Expand Down

0 comments on commit fd52a68

Please sign in to comment.