From b843abfc33d9653615bec69119304cb459b08985 Mon Sep 17 00:00:00 2001 From: Vickie Ye Date: Tue, 3 Oct 2023 16:32:48 +0000 Subject: [PATCH] adding ndc pixel factor for sceenspace grads --- nerfstudio/models/gaussian_splatting_inhouse.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nerfstudio/models/gaussian_splatting_inhouse.py b/nerfstudio/models/gaussian_splatting_inhouse.py index 50abf96fc..d6bb12c72 100644 --- a/nerfstudio/models/gaussian_splatting_inhouse.py +++ b/nerfstudio/models/gaussian_splatting_inhouse.py @@ -515,9 +515,11 @@ class GaussianSplattingModel(Model): background = torch.rand(3, device=self.device) else: background = torch.zeros(3, device=self.device) + pix_fac = torch.tensor([0.5 * W, 0.5 * H], device=self.device)[None].repeat(self.num_points, 1) + pix_means = self.proj_means * pix_fac xys, depths, self.radii, conics, num_tiles_hit, self.cov3d = ProjectGaussians.apply( self.means, - self.proj_means, + pix_means, torch.exp(self.scales), 1, self.quats,