Skip to content

Commit

Permalink
remove num_sh_bases
Browse files Browse the repository at this point in the history
  • Loading branch information
Jianbo Ye committed Sep 5, 2024
1 parent c4953f1 commit 10bc0e3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nerfstudio/models/splatfacto.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from gsplat.rendering import rasterization
except ImportError:
print("Please install gsplat>=1.0.0")
from gsplat.cuda_legacy._wrapper import num_sh_bases
from pytorch_msssim import SSIM
from torch.nn import Parameter

Expand All @@ -47,6 +46,14 @@
from nerfstudio.utils.rich_utils import CONSOLE


def num_sh_bases(degree: int) -> int:
"""
Returns the number of spherical harmonic bases for a given degree.
"""
assert degree <= 4, "We don't support degree greater than 4."
return (degree + 1) ** 2


def quat_to_rotmat(quat):
assert quat.shape[-1] == 4, quat.shape
w, x, y, z = torch.unbind(quat, dim=-1)
Expand Down

0 comments on commit 10bc0e3

Please sign in to comment.