Fix point-cloud limiting for float logits#29
Conversation
thetianshuhuang
left a comment
There was a problem hiding this comment.
I think there's a high level change that's been missed. This implementation is implicitly changing the abstraction; instead of arbitrary passing to PointCloudMetric.as_points and being turned into points, we're assuming grid-like is the argument, and as_points is responsible for taking an occupancy grid and turning it into N-dimensional Cartesian points. So if/when we add Chamfer for a modality that breaks this assumption (e.g., depth images), the current design won't work. This is in part also an existing issue with the code.
As an idea, what if we move max_points into Chamfer2D and Chamfer3D, and put _limit as a @staticmethod? Then Chamfer2D, Chamfer3D can "own" the responsibility of both subsampling and generating points.
Fixes point-cloud limiting so float logits are converted to boolean occupancy masks before
as_points. Logits are still used for weighted sampling, but_limitnow consistently returns Bool tensors.