mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-07 00:09:14 +08:00
Remove unused code
This commit is contained in:
1 parent
69d65b5de7
commit
00b942d6f8
1 file changed
-5
@@ -73,17 +73,12 @@ def test_spherical_harmonics_rotation_splatfacto(sh_degree):
|
|||||||
sh_coeffs = torch.rand(N, 3, num_coeffs)
|
sh_coeffs = torch.rand(N, 3, num_coeffs)
|
||||||
dirs = torch.rand(N, 3)
|
dirs = torch.rand(N, 3)
|
||||||
dirs = dirs / torch.linalg.norm(dirs, dim=-1, keepdim=True)
|
dirs = dirs / torch.linalg.norm(dirs, dim=-1, keepdim=True)
|
||||||
|
|
||||||
assert dirs.shape == (N, 3)
|
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)
|
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")
|
sh_coeffs_rotated = rotate_spherical_harmonics(rot_matrix, sh_coeffs, component_convention="-y,+z,-x")
|
||||||
dirs_rotated = (rot_matrix @ dirs.T).T
|
dirs_rotated = (rot_matrix @ dirs.T).T
|
||||||
assert dirs_rotated.shape == (N, 3)
|
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(
|
torch.testing.assert_close(
|
||||||
gsplat_spherical_harmonics(sh_degree, coeffs=sh_coeffs.swapaxes(-1, -2), dirs=dirs),
|
gsplat_spherical_harmonics(sh_degree, coeffs=sh_coeffs.swapaxes(-1, -2), dirs=dirs),
|
||||||
|
|||||||
Reference in new issue
Block a user