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

Refactor for simplification #9054

Merged
merged 3 commits into from
Aug 20, 2022
Merged

Refactor for simplification #9054

merged 3 commits into from
Aug 20, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Aug 20, 2022

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhancements to file downloading, code cleanup, and improved device selection logic in ultralytics/yolov5 repo.

πŸ“Š Key Changes

  • 🌍 Downloads: The curl command in downloads.py and general.py now includes a progress bar with -#.
  • 🧹 Code Quality: Simplification of for-loops in metrics.py and list comprehensions in plots.py.
  • πŸ”§ Exception handling in plots.py has been streamlined using contextlib.suppress.
  • πŸ› οΈ Device Selection: Logic in torch_utils.py now succinctly checks for GPU availability with improved conditions.
  • 🎨 Code Cleanup: Refactoring and simplifications are done in torch_utils.py for smartCrossEntropyLoss function.

🎯 Purpose & Impact

  • πŸš€ Improved User Experience: The progress bar during file downloads provides feedback, enhancing the user interface.
  • 🧼 Cleaner Code: Code simplifications make maintenance easier and improve readability for developers.
  • βš™οΈ Better Handling: Streamlined error suppression in plots minimizes unneeded try-except blocks, improving performance.
  • πŸ–₯️ Smoother Setup: Enhanced device selection logic helps avoid potential errors during setup, especially with GPU/CPU device allocations.

These updates are expected to provide both an improved experience for users interacting with download functionalities and a cleaner, more maintainable codebase for developers contributing to the project.

@glenn-jocher glenn-jocher self-assigned this Aug 20, 2022
@glenn-jocher glenn-jocher merged commit c725511 into master Aug 20, 2022
@glenn-jocher glenn-jocher deleted the update/refactor branch August 20, 2022 23:34
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Refactor for simplification

* cleanup

* [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