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

Add notebook_init() to utils/__init__.py #5488

Merged
merged 11 commits into from
Nov 9, 2021
Merged

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Nov 3, 2021

PR features shorter and simpler YOLOv5 notebook Setup cell:

Screenshot 2021-11-09 at 22 58 47

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Refinement of YOLOv5 Tutorial Notebook and Initialization Utilities

πŸ“Š Key Changes

  • Updated Colab Badge Link: Modified Colab badge link to point to a branch-specific notebook URL.
  • Streamlined Setup Code: Simplified the notebook setup steps, including command comments and removed explicit Torch dependency code snippets.
  • Enhanced Import & Initialization: Replaced direct imports and print statements with a new utils.notebook_init function call to check setup.
  • Image Display Update: Switched from the IPython display method to a new utils.notebook_init managed method for displaying images.
  • Comment & Output Cleanup: Removed some comments and reset execution counts for blocks, signifying they need to be run afresh.
  • New Utility Function: Added notebook_init in the utils module to manage setup for notebooks.
  • Adjusted select_device Function: Updated the torch_utils.select_device function to include a newline option, now removing trailing newlines in specific scenarios.

🎯 Purpose & Impact

  • Improved User Experience: The updated links and setup steps provide a smoother, more streamlined start-up for users trying out YOLOv5 notebooks.
  • Code Clarity: Simplification of initial commands helps users better understand the steps required to set up their environment.
  • Consistency in Display: By standardizing the way images are displayed in the notebook with the new method, there is less room for errors and a more uniform output presentation.
  • Maintenance and Reusability: The addition of the notebook_init function suggests a move toward modular code, which is easier to maintain and update, providing a single point of setup adjustments for future changes.
  • Potential for Wide Impact: These changes could affect all new users experimenting with the Ultralytics YOLOv5 tutorial notebook, thus enhancing the initial learning curve.

@glenn-jocher glenn-jocher self-assigned this Nov 5, 2021
@glenn-jocher glenn-jocher changed the title Add init_notebook() to __init__.py Add notebook_init() to utils/__init__.py Nov 9, 2021
@glenn-jocher
Copy link
Member Author

PR is done. Features shorter and simpler YOLOv5 notebook Setup cell:

Screenshot 2021-11-09 at 22 58 47

@glenn-jocher glenn-jocher merged commit 7ebb5e5 into master Nov 9, 2021
@glenn-jocher glenn-jocher deleted the update/notebook branch November 9, 2021 22:03
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Update __init__.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* notebook_init

* notebook_init

* notebook_init

* notebook_init

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* notebook_init

* Created using Colaboratory

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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