Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix in cotcurv laplacian loss. closes #551 #553

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pytorch3d/loss/mesh_laplacian_smoothing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand All @@ -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
Expand Down