mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-03 22:38:48 +08:00
Fix bug: sh render is not correct (#1667)
* Update renderers.py revise the SH renderer * Update test_renderers.py change the test target for sh render
This commit is contained in:
1 parent
35cd06ef36
commit
24b3db8eb0
2 files changed
+2
-2
No files matched your search
@@ -180,7 +180,7 @@ class SHRenderer(nn.Module):
|
|||||||
components = components_from_spherical_harmonics(levels=levels, directions=directions)
|
components = components_from_spherical_harmonics(levels=levels, directions=directions)
|
||||||
|
|
||||||
rgb = sh * components[..., None, :] # [..., num_samples, 3, sh_components]
|
rgb = sh * components[..., None, :] # [..., num_samples, 3, sh_components]
|
||||||
rgb = torch.sum(sh, dim=-1) + 0.5 # [..., num_samples, 3]
|
rgb = torch.sum(rgb, dim=-1) # [..., num_samples, 3]
|
||||||
|
|
||||||
if self.activation is not None:
|
if self.activation is not None:
|
||||||
rgb = self.activation(rgb)
|
rgb = self.activation(rgb)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ def test_sh_renderer():
|
|||||||
sh_renderer = renderers.SHRenderer()
|
sh_renderer = renderers.SHRenderer()
|
||||||
|
|
||||||
rgb = sh_renderer(sh=sh, directions=directions, weights=weights)
|
rgb = sh_renderer(sh=sh, directions=directions, weights=weights)
|
||||||
assert torch.max(rgb) > 0.9
|
assert torch.max(rgb) > 0.7
|
||||||
|
|
||||||
|
|
||||||
def test_acc_renderer():
|
def test_acc_renderer():
|
||||||
|
|||||||
Reference in new issue
Block a user