From d322c5171fd26e3b67578080e33f380c3f5363ff Mon Sep 17 00:00:00 2001 From: HwanHeo Date: Mon, 1 Jul 2024 10:11:44 +0900 Subject: [PATCH] Update mesh_utils.py 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. --- utils/mesh_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/mesh_utils.py b/utils/mesh_utils.py index 5ab465d4..d10d4276 100644 --- a/utils/mesh_utils.py +++ b/utils/mesh_utils.py @@ -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")) \ No newline at end of file + # 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"))