Move util functions out of splatfacto (#3538)

* Move util functions out of splatfacto

Nothing else currently uses some of the SH utils, but it might make sense to get them out of splatfacto.

I also moved the k nearest neighbors to utils since it doesn't depend on the model class.

* fix assert

* fix sh test

* convert to using degrees, not levels
This commit is contained in:
Alexander Kristoffersen authored and GitHub committed 2024-12-05 13:25:55 -05:00
1 parent e8bf472692
commit a8888e7d9e
8 files changed
+207 -181

No files matched your search

+2 -2
View File
@@ -125,11 +125,11 @@ def test_tensor_cp_encoder():
def test_tensor_sh_encoder():
"""Test Spherical Harmonic encoder"""
levels = 4
levels = 5
out_dim = levels**2
with pytest.raises(ValueError):
encoder = encodings.SHEncoding(levels=5)
encoder = encodings.SHEncoding(levels=6)
encoder = encodings.SHEncoding(levels=levels)
assert encoder.get_out_dim() == out_dim