Skip to content

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.

1 participant