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

plot_one_box() default color=(128, 128, 128) #3240

Merged
merged 2 commits into from
May 19, 2021

Conversation

yeric1789
Copy link
Contributor

@yeric1789 yeric1789 commented May 19, 2021

if color is None calling tuple(color) can cause error 'NoneType' object is not iterable

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Standardized default box color for bounding box plots.

📊 Key Changes

  • Default color for bounding boxes in plots has been set to a mid-tone gray (128, 128, 128).
  • Removed random color selection for plots.
  • Simplified font size calculation and arguments for plotting box labels.

🎯 Purpose & Impact

  • 🎨 Consistency in Visualization: Default color standardization provides a uniform look for boxes when no specific color is given.
  • Simplified Codebase: Removing random color generation reduces code complexity and potential for visual clutter.
  • 🖨️ Font Handling Improvement: Streamlines the font size determination for labels, making it easier to maintain and potentially avoiding scaling issues across different image resolutions.

This PR enhances the overall usability and consistency of the visual output in YOLOv5, while also reducing potential bugs related to font sizing and randomization.

@glenn-jocher glenn-jocher changed the title Color can be none by default plot_one_box() default color=(128, 128, 128) May 19, 2021
@glenn-jocher
Copy link
Member

@yeric1789 thanks for spotting this bug! I've cleaned this up a bit but the idea is solid. Thank you for your contributions!

@glenn-jocher glenn-jocher merged commit 7b0eb95 into ultralytics:master May 19, 2021
@yeric1789 yeric1789 deleted the patch-1 branch May 19, 2021 19:20
Lechtr pushed a commit to Lechtr/yolov5 that referenced this pull request Jul 20, 2021
* Color can be none by default

* `plot_one_box()` default `color=(128, 128, 128)`

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
(cherry picked from commit 7b0eb95)
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Color can be none by default

* `plot_one_box()` default `color=(128, 128, 128)`

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
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

2 participants