mirror of
https://github.com/harry7557558/spirula-studio.git
synced 2026-10-02 02:44:54 +08:00
fix SH bug with non-unitary relative_scale
This commit is contained in:
@@ -764,7 +764,7 @@ class SpirulaeModel(Model):
|
||||
timerr.mark("map") # 300us-450us
|
||||
|
||||
if self.config.sh_degree > 0:
|
||||
viewdirs = self.means.detach() - optimized_camera_to_world[:3, 3].to(device) # (N, 3)
|
||||
viewdirs = self.means.detach() - T.squeeze(-1).to(device) # (N, 3)
|
||||
n = min(self.step // self.config.sh_degree_interval, self.config.sh_degree)
|
||||
rgbs = spherical_harmonics(n, viewdirs, self.features_dc, self.features_sh) # input unnormalized viewdirs
|
||||
rgbs = rgbs + 0.5
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ def _test_sh(method):
|
||||
optim.zero_grad()
|
||||
|
||||
# compute PyTorch's color and grad
|
||||
check_colors = _torch_impl.compute_sh_color(viewdirs, sh_coeffs, method)
|
||||
check_colors = _torch_impl.compute_sh_color(viewdirs, sh_coeffs, "poly")
|
||||
check_loss = torch.square(check_colors - gt_colors).mean()
|
||||
check_loss.backward()
|
||||
check_grad = sh_coeffs.grad.detach()
|
||||
|
||||
Reference in New Issue
Block a user