pytorch3d icon indicating copy to clipboard operation
pytorch3d copied to clipboard

Add "forward chamfer distance" in pytorch3d.loss.chamfer

Open JiahaoPlus opened this issue 4 years ago • 3 comments

🚀 Feature

Forward chamfer distance (chamfer distance only from source to target)

Motivation

Currently, in pytorch3d.loss.chamfer, the chamfer_distance function can returns "cham_dist = cham_x + cham_y". However, in many cases, we only need "forward chamfer distance", i.e., "cham_x" in the code.

Pitch

It would be great to have a parameter (i.e., direction = "forward" or "bidirectional") to choose which to return (cham_x or cham_x + cham_y).

JiahaoPlus avatar Jan 04 '21 23:01 JiahaoPlus

The definition of chamfer is what you call here "bidirectional". If you want to compute only the one-directional distance, this should likely be called something else, not chamfer. We can add such a function for convenience.

gkioxari avatar Jan 06 '21 01:01 gkioxari

Yes, agree. Thanks for your effort!

JiahaoPlus avatar Jan 06 '21 20:01 JiahaoPlus

Any updates on when this loss function will be released?

low5545 avatar Sep 05 '21 05:09 low5545