Skip to content

Allow K=1 in draw_keypoints #8439

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

Merged
merged 3 commits into from
May 28, 2024
Merged

Allow K=1 in draw_keypoints #8439

merged 3 commits into from
May 28, 2024

Conversation

haarisr
Copy link
Contributor

@haarisr haarisr commented May 23, 2024

The squeeze here makes draw keypoints not work when K=1. In my use case, I want to draw a unique color for each keypoint. So currently, I iterate over every keypoint to select a unique color i.e dim 1. The squeeze seems redundant and it should work regardless of it. There is a check on line 401 as well.

It could also be that I have not understood the comment completely.

Copy link

pytorch-bot bot commented May 23, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8439

Note: Links to docs will display an error until the docs builds have been completed.

❌ 12 New Failures, 1 Unrelated Failure

As of commit f789651 with merge base 61d97f4 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link

Hi @haarisr!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@NicolasHug
Copy link
Member

Thanks for the PR @haarisr .

To enable your original use-case, I feel like we should just allow colors to be a list of colors of length K, so that each keypoint could have its own color. Would that address your use-case?

@haarisr
Copy link
Contributor Author

haarisr commented May 24, 2024

To enable your original use-case, I feel like we should just allow colors to be a list of colors of length K, so that each keypoint could have its own color. Would that address your use-case?

It would but we should also enable the option to draw on a single keypoint on the image? It seems counter intuitive that the function would not work in such a case.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@NicolasHug
Copy link
Member

OK, fair enough. I slightly updated the PR so that it doesn't entirely remove the squeeze() (which is still useful) and instead only call it if the number of dimension is 3.

Thanks for the PR @haarisr , I'll merge it in a bit.

@NicolasHug NicolasHug changed the title Remove squeeze on visibility in draw_keypoints Allow K=1 in draw_keypoints May 28, 2024
@NicolasHug NicolasHug merged commit 337fa34 into pytorch:main May 28, 2024
68 of 81 checks passed
facebook-github-bot pushed a commit that referenced this pull request Jun 7, 2024
Summary: Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>

Reviewed By: vmoens

Differential Revision: D58283863

fbshipit-source-id: d461dacb65272f4d8b477008ff1c8d33d3bd1141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants