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 is_colab() function #3018

Merged
merged 1 commit into from
May 3, 2021
Merged

Add is_colab() function #3018

merged 1 commit into from
May 3, 2021

Conversation

glenn-jocher
Copy link
Member

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

This PR should allow YouTube inference in Colab environments which were crashing due to cv2.imshow().

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhancement of the environment detection capabilities in the Ultralytics YOLOv5 utility functions.

📊 Key Changes

  • Renamed the isdocker() function to is_docker() to follow the Python naming conventions.
  • Added a new function is_colab() to detect if the code is running within a Google Colab environment.
  • Updated check_git_status() and check_imshow() functions to incorporate the new is_docker() name.
  • Extended check_imshow() to disable image displays in Google Colab environments in addition to Docker.

🎯 Purpose & Impact

  • 🎨 Improved code readability and consistency with the renaming of isdocker to is_docker.
  • 🧪 Enhanced environment checks help users avoid running image display functions in unsupported environments like Docker and Google Colab, avoiding potential errors and confusion.
  • 🔄 General maintenance and verifications are more robust, reducing potential issues for developers working in different environments.

@glenn-jocher glenn-jocher linked an issue May 3, 2021 that may be closed by this pull request
@glenn-jocher glenn-jocher self-assigned this May 3, 2021
@glenn-jocher glenn-jocher added the bug Something isn't working label May 3, 2021
@glenn-jocher glenn-jocher merged commit fcd5702 into master May 3, 2021
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-5 branch May 3, 2021 10:37
KMint1819 pushed a commit to KMint1819/yolov5 that referenced this pull request May 12, 2021
danny-schwartz7 pushed a commit to danny-schwartz7/yolov5 that referenced this pull request May 22, 2021
Lechtr pushed a commit to Lechtr/yolov5 that referenced this pull request Jul 20, 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
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AssertionError: Failed to open youtube link
1 participant