Fix coordinates-to-coordinates score() passing kwargs __call__ rejects#27
Open
jkosinski wants to merge 2 commits into
Open
Fix coordinates-to-coordinates score() passing kwargs __call__ rejects#27jkosinski wants to merge 2 commits into
jkosinski wants to merge 2 commits into
Conversation
_MatchCoordinatesToCoordinates.score() called
self(transformed_coordinates=..., transformed_coordinates_mask=...)
but the concrete __call__ of its subclasses (Chamfer, NormalVectorScore) take no arguments —
they read self.template_coordinates_rotated, which _rigid_transform already writes via
out=self.template_coordinates_rotated. So every optimize_match call on a coordinates-to-
coordinates score raised TypeError ("__call__() got an unexpected keyword argument
'transformed_coordinates'").
Match the coordinates-to-density base (_MatchCoordinatesToDensity.score), which calls self()
with no kwargs. Chamfer now optimises; NormalVectorScore still needs equal-size paired point
clouds (separate issue in its __call__).
…alls __call__ without args) _MatchCoordinatesToCoordinates.score() must call __call__ without arguments -- Chamfer.__call__ takes none and reads self.template_coordinates_rotated written by _rigid_transform. Test the score directly and through optimize_match (maxiter=1).
Author
|
Out of scope for this PR, noted for later: NormalVectorScore.call does not multiply its result by self.score_sign (unlike Chamfer and the other scores), so its sign convention is inconsistent. Can be fixed in a follow-up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
optimize_matchon any coordinates-to-coordinates score (Chamfer,NormalVectorScore) raises:_MatchCoordinatesToCoordinates.score()callsbut the concrete
__call__methods (Chamfer,NormalVectorScore) take no arguments — theyread
self.template_coordinates_rotated, which_rigid_transform(..., out=self.template_coordinates_rotated)has already written. So the kwargs are spurious and break the call.
Fix
Make the coordinates-to-coordinates
score()callself()with no kwargs, matching thecoordinates-to-density base (
_MatchCoordinatesToDensity.score, which doesreturn self()).Effect
Chamfernow optimises throughoptimize_match.NormalVectorScorestill needs equal-sizepre-paired point clouds (its
__call__multipliestemplate_coordinates_rotated * target_coordinateselementwise) — a separate issue, noted but not addressed here.