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 forward() method profiling #4816

Merged
merged 1 commit into from
Sep 16, 2021
Merged

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Sep 15, 2021

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Refactoring and cleanup of the YOLOv5 forward pass methods.

πŸ“Š Key Changes

  • Removed commented out logger info lines that were not in use.
  • forward_augment and forward_once methods have been renamed to _forward_augment and _forward_once to signify their intended private use.
  • Extracted profiling code into separate method _profile_one_layer to clean up the forward and _forward_once methods.

🎯 Purpose & Impact

  • 🧹 Cleaner Codebase: Removal of commented code and refactoring for a cleaner, more maintainable codebase.
  • πŸ›‘οΈ Clearer Method Access: Underscore prefix on method names signifies these methods are internal and helps prevent their unintended use from outside the class.
  • πŸ” Better Profiling and Visualization: Separation of profiling responsibility into a dedicated method makes the codebase easier to understand and maintain, potentially aiding in performance optimization efforts.
  • πŸ“‰ Potential Decrease in Mistakes: Separating profiling code reduces clutter, which can decrease the chance of accidental errors during future maintenance.

@glenn-jocher glenn-jocher merged commit 0dc725e into master Sep 16, 2021
@glenn-jocher glenn-jocher deleted the update/yolo_forward_profile branch September 16, 2021 07:47
CesarBazanAV pushed a commit to CesarBazanAV/yolov5 that referenced this pull request Sep 29, 2021
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
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