From 04d4a12bd49d95f5581789b050942cbe497b69ca Mon Sep 17 00:00:00 2001 From: lizhiqi49 Date: Tue, 5 Nov 2024 21:58:43 +0800 Subject: [PATCH] fix some bugs --- .../threestudio-dreammesh4d/configs/sugar_dynamic_dg.yaml | 2 +- custom/threestudio-dreammesh4d/geometry/sugar.py | 8 ++++---- .../renderer/diff_sugar_rasterizer_normal.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/custom/threestudio-dreammesh4d/configs/sugar_dynamic_dg.yaml b/custom/threestudio-dreammesh4d/configs/sugar_dynamic_dg.yaml index 525d8a5..e526b8f 100755 --- a/custom/threestudio-dreammesh4d/configs/sugar_dynamic_dg.yaml +++ b/custom/threestudio-dreammesh4d/configs/sugar_dynamic_dg.yaml @@ -144,7 +144,7 @@ system: lambda_normal: 0. lambda_normal_smooth: 0. lambda_normal_consistency: 100. - lambda_normal_depth_consistency: 1. + lambda_normal_depth_consistency: 0. lambda_laplacian_smoothing: 0. lambda_arap_reg_key_frame: 10. lambda_arap_reg_inter_frame: 10. diff --git a/custom/threestudio-dreammesh4d/geometry/sugar.py b/custom/threestudio-dreammesh4d/geometry/sugar.py index f5d6148..d02cf8d 100644 --- a/custom/threestudio-dreammesh4d/geometry/sugar.py +++ b/custom/threestudio-dreammesh4d/geometry/sugar.py @@ -182,9 +182,9 @@ def load_surface_mesh_to_bind(self, mesh=None): vert_colors = np.array(o3d_mesh.vertex_colors) if len(vert_colors) == 0: vert_colors = np.ones_like(verts) * 0.5 - # verts, faces, vert_colors = self.prune_isolated_points( - # verts, faces, vert_colors - # ) + verts, faces, vert_colors = self.prune_isolated_points( + verts, faces, vert_colors + ) self.register_buffer( "_surface_mesh_faces", torch.as_tensor(faces, device=self.device) ) @@ -519,7 +519,7 @@ def quaternions(self): @property def get_face_normals(self) -> Float[Tensor, "N_faces 3"]: - return - F.normalize(self.surface_mesh.faces_normals_list()[0], dim=-1) + return F.normalize(self.surface_mesh.faces_normals_list()[0], dim=-1) @property def get_gs_normals(self) -> Float[Tensor, "N_gs 3"]: diff --git a/custom/threestudio-dreammesh4d/renderer/diff_sugar_rasterizer_normal.py b/custom/threestudio-dreammesh4d/renderer/diff_sugar_rasterizer_normal.py index 50a0eff..6819715 100644 --- a/custom/threestudio-dreammesh4d/renderer/diff_sugar_rasterizer_normal.py +++ b/custom/threestudio-dreammesh4d/renderer/diff_sugar_rasterizer_normal.py @@ -194,7 +194,7 @@ def forward( cov3D_precomp=cov3D_precomp, ) normal = F.normalize(normal, dim=0) - normal = - normal # the mesh extracted by sugar has inward-pointing normals + # normal = - normal # the mesh extracted by sugar has inward-pointing normals normal_map = normal * 0.5 * rendered_alpha + 0.5 mask = rendered_alpha > 0.99 normal_mask = mask.repeat(3, 1, 1)