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

Add @threaded decorator #7813

Merged
merged 2 commits into from
May 14, 2022
Merged

Add @threaded decorator #7813

merged 2 commits into from
May 14, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented May 14, 2022

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhancements to threading and logging in the YOLOv5 codebase.

πŸ“Š Key Changes

  • Added a threaded decorator to manage the creation and start of threads in a more Pythonic way.
  • Removed direct usage of Thread from threading and replaced with the @threaded decorator.
  • Streamlined dictionary creation with direct dict(zip(...)) usage for better readability.
  • Cleaned up and refactored logging callbacks to be more concise.
  • Amended a check in plot_images for determining if a label fits outside the box.
  • Updated variable naming for color palettes to improve code clarity.
  • General code cleanups like removing unused imports and simplifying function calls.

🎯 Purpose & Impact

  • The introduction of the @threaded decorator simplifies multi-threading, reducing code verbosity, and potentially lowering the risk of errors associated with thread management.
  • Changes to the logging process and dictionary creations make the code easier to read, understand, and maintain, which benefits developers working on the codebase.
  • Tweaks to the plotting function affect the presentation of visual results and improve decision-making for positioning box labels.
  • Overall impact includes cleaner, more maintainable code with potentially fewer bugs, leading to an improved experience for contributors and end-users of YOLOv5. πŸ§‘β€πŸ’»πŸ› οΈ

@glenn-jocher glenn-jocher self-assigned this May 14, 2022
@glenn-jocher glenn-jocher merged commit 4a295b1 into master May 14, 2022
@glenn-jocher glenn-jocher deleted the update/threaded branch May 14, 2022 14:12
tdhooghe pushed a commit to tdhooghe/yolov5 that referenced this pull request Jun 10, 2022
* Add `@threaded` decorator

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Add `@threaded` decorator

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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.

1 participant