-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Extend default heuristic of SanitizeBoundingBoxes to support tuples #7304
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
Conversation
| if sample_type is tuple: | ||
| sample = (None, sample, "whatever_again") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this show a bug in the implementation? Shouldn't we require the tuple to only have two elements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can, I just went for this because it felt like an artificial restriction. I.e. I don't see more things going wrong by allowing tuples with 3+ entries. And not raising an error actually makes the code simpler. But I don't have a strong opinion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Maybe put a note of that in the comment of _get_dict_or_second_tuple_entry. So far it only uses a two-tuple as example.
Co-authored-by: Philip Meier <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Nicolas, LGTM if CI is green.
| if sample_type is tuple: | ||
| sample = (None, sample, "whatever_again") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Maybe put a note of that in the comment of _get_dict_or_second_tuple_entry. So far it only uses a two-tuple as example.
|
Hey @NicolasHug! You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py |
…ytorch#7304) Co-authored-by: Philip Meier <[email protected]>
… tuples (#7304) Summary: Co-authored-by: Philip Meier <[email protected]> Reviewed By: vmoens Differential Revision: D44416594 fbshipit-source-id: dc22119387695f5d8583f0745b2c80260a9d8b87
This PR adds support for tuples in the default heuristic of
SanitizeBoundingBoxes.This is needed because a lot of our built-in datasets return
(img, dict_of_stuff)instead of justdict, which is what the current heuristic expects. This addresses a current UX painpoint #7302 (comment)