mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-05 23:38:42 +08:00
Fix normal orientation loss (#1298)
Co-authored-by: Abhik Ahuja <ahujaabhik@berkeley.edu>
This commit is contained in:
1 parent
7979310def
commit
8c41a263b8
1 file changed
+1
-1
@@ -193,7 +193,7 @@ def orientation_loss(
|
|||||||
"""
|
"""
|
||||||
w = weights
|
w = weights
|
||||||
n = normals
|
n = normals
|
||||||
v = viewdirs
|
v = viewdirs * -1
|
||||||
n_dot_v = (n * v[..., None, :]).sum(axis=-1)
|
n_dot_v = (n * v[..., None, :]).sum(axis=-1)
|
||||||
return (w[..., 0] * torch.fmin(torch.zeros_like(n_dot_v), n_dot_v) ** 2).sum(dim=-1)
|
return (w[..., 0] * torch.fmin(torch.zeros_like(n_dot_v), n_dot_v) ** 2).sum(dim=-1)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user