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

Attach transforms to model #9028

Merged
merged 3 commits into from
Aug 18, 2022
Merged

Attach transforms to model #9028

merged 3 commits into from
Aug 18, 2022

Conversation

glenn-jocher
Copy link
Member

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

Signed-off-by: Glenn Jocher [email protected]

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Refactored image classification training and validation scripts for consistency and simplicity.

📊 Key Changes

  • 🔄 Moved the attachment of class names (model.names) to a more appropriate place in the training script to synchronize with the model information.
  • ✂️ Removed unnecessary conversion of model to .float() in the validation file, aligning with the decision to remove half-precision inference (half=False).
  • 🏷️ Standardized the use of model.names across both training and testing image displays for consistency.
  • 🔗 Attached inference transforms (model.transforms) directly to the model within the training script for better accessibility.

🎯 Purpose & Impact

  • 💡 Consistency: By moving model.names up to the model information section, it ensures class names are set before any logging or visualization, avoiding potential errors.
  • 🔍 Clarity: Removing the float conversion from validation simplifies the code and the decision to go against half-precision inference ensures more stable and predictable model behavior.
  • 🖼️ Visualization: Standardizing how class names are used in image displays helps maintain consistency during train and test visualization steps.
  • 📈 Reliability: The changes prioritize model reliability and code maintainability without sacrificing performance, aiming for more robust and understandable image classification processes.

Signed-off-by: Glenn Jocher <[email protected]>
@glenn-jocher glenn-jocher self-assigned this Aug 18, 2022
Signed-off-by: Glenn Jocher <[email protected]>
Signed-off-by: Glenn Jocher <[email protected]>
@glenn-jocher glenn-jocher merged commit 840b723 into master Aug 18, 2022
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-1 branch August 18, 2022 23:59
glenn-jocher added a commit that referenced this pull request Aug 19, 2022
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Attach transforms to model

Signed-off-by: Glenn Jocher <[email protected]>

* Update val.py

Signed-off-by: Glenn Jocher <[email protected]>

* Update train.py

Signed-off-by: Glenn Jocher <[email protected]>

Signed-off-by: Glenn Jocher <[email protected]>
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