Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Jan 21, 2025
1 parent 69d65b5 commit 00b942d
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions tests/utils/test_spherical_harmonics.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,12 @@ def test_spherical_harmonics_rotation_splatfacto(sh_degree):
sh_coeffs = torch.rand(N, 3, num_coeffs)
dirs = torch.rand(N, 3)
dirs = dirs / torch.linalg.norm(dirs, dim=-1, keepdim=True)

assert dirs.shape == (N, 3)
y_lm = gsplat_eval_sh_bases(num_coeffs, dirs)
color_original = (sh_coeffs * y_lm[..., None, :]).sum(dim=-1)

rot_matrix = torch.tensor(ScR.random().as_matrix(), dtype=torch.float32)
sh_coeffs_rotated = rotate_spherical_harmonics(rot_matrix, sh_coeffs, component_convention="-y,+z,-x")
dirs_rotated = (rot_matrix @ dirs.T).T
assert dirs_rotated.shape == (N, 3)
y_lm_rotated = gsplat_eval_sh_bases(num_coeffs, dirs_rotated)
color_rotated = (sh_coeffs_rotated * y_lm_rotated[..., None, :]).sum(dim=-1)

torch.testing.assert_close(
gsplat_spherical_harmonics(sh_degree, coeffs=sh_coeffs.swapaxes(-1, -2), dirs=dirs),
Expand Down

0 comments on commit 00b942d

Please sign in to comment.