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

Use average coordinate of merged keypoints during NMS #711

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

johnwlambert
Copy link
Collaborator

No description provided.

@johnwlambert johnwlambert changed the base branch from master to add-pure-retrieval-baseline September 14, 2023 03:05
Comment on lines +59 to +62
# Modify global keypoint coordinate to be set to average value of merged detections, instead of
# using the first identified coordinate.
updated_uv = np.mean([per_image_kpt_coordinates[i][img_global_kpt_idx], uv], axis=0)
per_image_kpt_coordinates[i][img_global_kpt_idx] = updated_uv
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you take the mean after you've determined which keypoints are to be merged?

Base automatically changed from add-pure-retrieval-baseline to master September 15, 2023 02:01
is_identical = np.any(diff_norms == 0)
if len(per_image_kpt_coordinates[i]) > 0 and is_identical:
is_duplicate = np.any(diff_norms <= self.nms_merge_radius)
if len(per_image_kpt_coordinates[i]) > 0 and is_duplicate:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you tested with len(per_image_kpt_coordinates[i]) == 0? does the <= work with empty arrrays?
Also np.any should be false in that case, so you would not need that condition at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants