Add label_colors argument to draw_bounding_boxes#8578
Merged
NicolasHug merged 4 commits intopytorch:mainfrom Nov 28, 2024
Merged
Add label_colors argument to draw_bounding_boxes#8578NicolasHug merged 4 commits intopytorch:mainfrom
label_colors argument to draw_bounding_boxes#8578NicolasHug merged 4 commits intopytorch:mainfrom
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. |
NicolasHug
approved these changes
Nov 28, 2024
Member
NicolasHug
left a comment
There was a problem hiding this comment.
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. |
facebook-github-bot
pushed a commit
that referenced
this pull request
Jan 13, 2025
Summary: Co-authored-by: Nicolas Hug <contact@nicolas-hug.com> Reviewed By: vmoens Differential Revision: D68021986 fbshipit-source-id: 52148ab7fd8c55a3dfba3d0d8eeca16599ac9da3
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.
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_kwargsargument 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