Skip to content

Commit

Permalink
Update mesh_utils.py
Browse files Browse the repository at this point in the history
Simple fix. 

If image calibration is performed through COLMAP undistortion, the image size of the dataset may be different, so it cannot be created as a nested tensor with 'torch.stack'. 
Even with the List of tensors, there are no errors in the subsequent algorithms.
hwanhuh authored Jul 1, 2024
1 parent c6e0b75 commit d322c51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/mesh_utils.py
Original file line number Diff line number Diff line change
@@ -116,8 +116,8 @@ def reconstruction(self, viewpoint_stack):
# self.normals.append(normal.cpu())
# self.depth_normals.append(depth_normal.cpu())

self.rgbmaps = torch.stack(self.rgbmaps, dim=0)
self.depthmaps = torch.stack(self.depthmaps, dim=0)
# self.rgbmaps = torch.stack(self.rgbmaps, dim=0)
# self.depthmaps = torch.stack(self.depthmaps, dim=0)
# self.alphamaps = torch.stack(self.alphamaps, dim=0)
# self.depth_normals = torch.stack(self.depth_normals, dim=0)
self.estimate_bounding_sphere()
@@ -292,4 +292,4 @@ def export_image(self, path):
save_img_u8(self.rgbmaps[idx].permute(1,2,0).cpu().numpy(), os.path.join(render_path, '{0:05d}'.format(idx) + ".png"))
save_img_f32(self.depthmaps[idx][0].cpu().numpy(), os.path.join(vis_path, 'depth_{0:05d}'.format(idx) + ".tiff"))
# save_img_u8(self.normals[idx].permute(1,2,0).cpu().numpy() * 0.5 + 0.5, os.path.join(vis_path, 'normal_{0:05d}'.format(idx) + ".png"))
# save_img_u8(self.depth_normals[idx].permute(1,2,0).cpu().numpy() * 0.5 + 0.5, os.path.join(vis_path, 'depth_normal_{0:05d}'.format(idx) + ".png"))
# save_img_u8(self.depth_normals[idx].permute(1,2,0).cpu().numpy() * 0.5 + 0.5, os.path.join(vis_path, 'depth_normal_{0:05d}'.format(idx) + ".png"))

0 comments on commit d322c51

Please sign in to comment.