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

Utils reorganization #1392

Merged
merged 7 commits into from
Nov 14, 2020
Merged

Utils reorganization #1392

merged 7 commits into from
Nov 14, 2020

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Nov 13, 2020

This PR reorganizes the utils directory, creating a more specialized separation of tasks into a finer grained distribution of utils files. Four new files are created. This will allow for better readability and segregation of future ML tasks, i.e. classification and segmentation, which will require additional metrics, losses and plots.

  • utils/autoanchor.py
  • utils/metrics.py
  • utils/loss.py
  • utils/plots.py

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Refactored the YOLOv5 codebase to tidy up modules and improve maintainability.

📊 Key Changes

  • Moved plot_one_box from utils.general to utils.plots
  • Introduced new modules utils.autoanchor, utils.loss, utils.metrics, utils.plots
  • Removed redundant imports and comments
  • Changed increment_path to use integer instead of ambiguous 1e3
  • Organized code by separating functions into appropriate modules
  • Deleted the redundant evolve.sh shell script

🎯 Purpose & Impact

  • 🔃 Better Code Organization: Splitting utils into multiple modules improves code readability and modularity.
  • 🧹 Cleaner Imports: Cleaning up imports reduces namespace cluttering and potential for import-related bugs.
  • 🚀 Maintenance Efficiency: More manageable codebase, supporting faster future development and debugging processes.
  • Removed Redundancy: Deleting the unused shell script and comments declutters the repository, streamlining the developer experience.

@glenn-jocher
Copy link
Member Author

This PR is complete. utils have been reorganized and unused functions and files have been removed, resulting in 100 lines of eliminated code :)

Added:

  • utils/autoanchor.py
  • utils/metrics.py
  • utils/loss.py
  • utils/plots.py

Removed:

  • evolve.sh

@glenn-jocher glenn-jocher merged commit fe341fa into master Nov 14, 2020
@glenn-jocher glenn-jocher deleted the utils_reorg branch November 14, 2020 10:50
burglarhobbit pushed a commit to burglarhobbit/yolov5 that referenced this pull request Jan 1, 2021
* Utils reorganization

* Add new utils files

* cleanup

* simplify

* reduce datasets.py

* remove evolve.sh

* loadWebcam cleanup
KMint1819 pushed a commit to KMint1819/yolov5 that referenced this pull request May 12, 2021
* Utils reorganization

* Add new utils files

* cleanup

* simplify

* reduce datasets.py

* remove evolve.sh

* loadWebcam cleanup
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Utils reorganization

* Add new utils files

* cleanup

* simplify

* reduce datasets.py

* remove evolve.sh

* loadWebcam cleanup
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