-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add 'None' option for point_reduction in chamfer_distance function #622
Comments
You can submit a PR and we are happy to review and accept it! |
The two point clouds used to calculate the Chamfer loss may have different numbers of points, so adding the bi-directional loss directly without reduction will cause the shape mismatch. If Add 'None' option for point_reduction in the chamfer_distance function, I think a better solution is to return the loss in the form of a tuple. |
@nematollahi, @gkioxari , @walsvid is there any new with this issue? |
I've found that I need this as well, I'll submit a PR. |
Summary: The `chamfer_distance` function currently allows `"sum"` or `"mean"` reduction, but does not support returning unreduced (per-point) loss terms. Unreduced losses could be useful if the user wishes to inspect individual losses, or perform additional modifications to loss terms before reduction. One example would be implementing a robust kernel over the loss. This PR adds a `None` option to the `point_reduction` parameter, similar to `batch_reduction`. In case of bi-directional chamfer loss, both the forward and backward distances are returned (a tuple of Tensors of shape `[D, N]` is returned). If normals are provided, similar logic applies to normals as well. This PR addresses issue #622. Pull Request resolved: #1605 Reviewed By: jcjohnson Differential Revision: D48313857 Pulled By: bottler fbshipit-source-id: 35c824827a143649b04166c4817449e1341b7fd9
🚀 Feature
Currently point_reduction entry in the chamfer_distance function should either be "mean" or "sum". That would be great to have the option of accessing output without any reduction.
Motivation
As the chamfer distance uses nearest neighbor for data association it is usually quite noisy. In practice it would be helpful to also enforce smoothing constraints (such as edge-aware smoothness) on the computed distance transform to reduce the noise. That's why having access to the not-reduced form of distance transform can be helpful.
Pitch
The text was updated successfully, but these errors were encountered: