mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-21 14:50:36 +08:00
Summary: Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/553 Reviewed By: theschnitz Differential Revision: D26257591 Pulled By: gkioxari fbshipit-source-id: 899a3f733a77361e8572b0900a34b55764ff08f2
This commit is contained in:
committed by
Facebook GitHub Bot
parent
17468e2862
commit
e13e63a811
@@ -108,6 +108,7 @@ def mesh_laplacian_smoothing(meshes, method: str = "uniform"):
|
||||
idx = norm_w > 0
|
||||
norm_w[idx] = 1.0 / norm_w[idx]
|
||||
else:
|
||||
L_sum = torch.sparse.sum(L, dim=1).to_dense().view(-1, 1)
|
||||
norm_w = 0.25 * inv_areas
|
||||
else:
|
||||
raise ValueError("Method should be one of {uniform, cot, cotcurv}")
|
||||
@@ -117,7 +118,7 @@ def mesh_laplacian_smoothing(meshes, method: str = "uniform"):
|
||||
elif method == "cot":
|
||||
loss = L.mm(verts_packed) * norm_w - verts_packed
|
||||
elif method == "cotcurv":
|
||||
loss = (L.mm(verts_packed) - verts_packed) * norm_w
|
||||
loss = (L.mm(verts_packed) - L_sum * verts_packed) * norm_w
|
||||
loss = loss.norm(dim=1)
|
||||
|
||||
loss = loss * weights
|
||||
|
||||
Reference in New Issue
Block a user