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 hubconf.py #1210

Merged
merged 1 commit into from
Oct 26, 2020
Merged

Update hubconf.py #1210

merged 1 commit into from
Oct 26, 2020

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Oct 26, 2020

This update prepares for PyTorch Hub page submission on https://github.com/pytorch/hub. PyTorch Hub tutorial has also been updated at #36

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improvements in YOLOv5 model creation and checkpoint loading.

πŸ“Š Key Changes

  • Introduced set_logging() at the beginning of hubconf.py to configure logging.
  • Replaced string formatting for file paths with f-strings for better readability and performance.
  • Streamlined the download and loading of pretrained model checkpoints.
  • Added a condition to set model class names from the checkpoint if the number of classes matches.
  • Included an example if __name__ == '__main__': block to demonstrate model creation.

🎯 Purpose & Impact

  • 🧰 Enhanced code clarity and maintainability by using modern string formatting techniques.
  • πŸ’‘ Simplified the process of loading pretrained weights, reducing potential for errors and improving user experience.
  • πŸ’Ό Ensured model's class labels are accurately assigned when the checkpoint's class count aligns with the user's specified number of classes.
  • πŸ“š Provided a handy example for users on how to instantiate a YOLOv5 model with pretrained weights.
  • πŸ”„ Overall, these updates may lead to a more intuitive and error-free experience for developers working with YOLOv5 models.

@glenn-jocher glenn-jocher merged commit 7f16406 into master Oct 26, 2020
@glenn-jocher glenn-jocher deleted the hubconf branch October 26, 2020 00:06
burglarhobbit pushed a commit to burglarhobbit/yolov5 that referenced this pull request Jan 1, 2021
KMint1819 pushed a commit to KMint1819/yolov5 that referenced this pull request May 12, 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