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

Update Detections() instance printing #9445

Merged
merged 3 commits into from
Sep 16, 2022
Merged

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Sep 16, 2022

Resolve double-printing in some environments

Signed-off-by: Glenn Jocher glenn.jocher@ultralytics.com

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Refinement of results display in the YOLOv5 model.

πŸ“Š Key Changes

  • Replaced display() method with _run() for internal operations, ensuring a more standard structure.
  • The string assembly process in the image information output is refined for clarity.
  • Moved the pretty-printing (pprint) logic out of the _run() method for better separation of concerns.
  • Enhanced code readability and maintainability by removing redundant code and clarifying method responsibilities.
  • Improved output formatting, removing trailing characters and organizing the output.
  • Modified class dunder methods (__str__, __repr__) to better represent the YOLOv5 result objects.

🎯 Purpose & Impact

  • 🎨 Improves the quality and readability of the output, making it more user-friendly.
  • πŸ‘· Automatic string cleaning and formatting tidy up output for users and logs.
  • 🧩 Separates visual display logic from result processing functions, allowing easier updates and maintenance of the codebase.
  • πŸ“ˆ Potential impact includes easier debugging, enhanced interpretation of model outputs, and a cleaner interface for interacting with the model's detections.

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher glenn-jocher self-assigned this Sep 16, 2022
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher glenn-jocher merged commit fe10b4a into master Sep 16, 2022
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-1 branch September 16, 2022 16:36
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

1 participant