From b1a35bc94bfb1a94c6f8aeca341978b4d32e094b Mon Sep 17 00:00:00 2001 From: bkerbl Date: Thu, 13 Jul 2023 13:12:45 +0200 Subject: [PATCH] Changed alpha init spatial lr behavior --- scene/gaussian_model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene/gaussian_model.py b/scene/gaussian_model.py index 699f02c..cd8c2ce 100644 --- a/scene/gaussian_model.py +++ b/scene/gaussian_model.py @@ -84,7 +84,7 @@ class GaussianModel: self.active_sh_degree += 1 def create_from_pcd(self, pcd : BasicPointCloud, spatial_lr_scale : float): - self.spatial_lr_scale = 5#spatial_lr_scale + self.spatial_lr_scale = 5 fused_point_cloud = torch.tensor(np.asarray(pcd.points)).float().cuda() fused_color = RGB2SH(torch.tensor(np.asarray(pcd.colors)).float().cuda()) features = torch.zeros((fused_color.shape[0], 3, (self.max_sh_degree + 1) ** 2)).float().cuda() @@ -98,7 +98,7 @@ class GaussianModel: rots = torch.zeros((fused_point_cloud.shape[0], 4), device="cuda") rots[:, 0] = 1 - opacities = inverse_sigmoid(0.5 * torch.ones((fused_point_cloud.shape[0], 1), dtype=torch.float, device="cuda")) + opacities = inverse_sigmoid(0.1 * torch.ones((fused_point_cloud.shape[0], 1), dtype=torch.float, device="cuda")) self._xyz = nn.Parameter(fused_point_cloud.requires_grad_(True)) self._features_dc = nn.Parameter(features[:,:,0:1].transpose(1, 2).contiguous().requires_grad_(True)) @@ -170,7 +170,7 @@ class GaussianModel: PlyData([el]).write(path) def reset_opacity(self): - opacities_new = inverse_sigmoid(torch.ones_like(self.get_opacity)*0.01) + opacities_new = inverse_sigmoid(torch.min(self.get_opacity, torch.ones_like(self.get_opacity)*0.01)) optimizable_tensors = self.replace_tensor_to_optimizer(opacities_new, "opacity") self._opacity = optimizable_tensors["opacity"]