-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Add label_colors
argument to draw_bounding_boxes
#8578
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8578
Note: Links to docs will display an error until the docs builds have been completed. ❌ 10 New Failures, 4 Unrelated FailuresAs of commit bf3876d with merge base 19fef3d ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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 a lot for the PR @carandraug . Sorry for the wait, I finally had a bit of free time to review it. It looks great, I'm happy to go with this simpler solution.
Hey @NicolasHug! You merged this PR, but no labels were added. |
Summary: Co-authored-by: Nicolas Hug <[email protected]> Reviewed By: vmoens Differential Revision: D68021986 fbshipit-source-id: 52148ab7fd8c55a3dfba3d0d8eeca16599ac9da3
Initial discussion and rational for this feature is in issue #8317 . As mentioned on that issue, this first PR addresses only the issue of label colour.
On issue #8317, I proposed to implement this by having a
draw_label_kwargs
argument which could then be passed todraw.text
. This would exposes all the flexibility provided by PIL (font stroke width, separate font fill and stroke colours, etc). However, after doing that, I think that this "simpler", albeit more limited, approach is better because my original proposal:messy when there are multiple boxes - we can pass a list of colours for the boxes and the same should be supported for the label colour. If we require a dict of kwargs then we would need a list of kwargs, many of them duplicated. It's just messy.
would bind us to PIL - if in the future this is done with something other than PIL then it would be difficult to keep BC
user needs to reference PIL documentation - not only the documentation is now elsewhere, different PIL versions support different arguments so it can be tricky for the user to know what arguments are supported