Enable GUI Visualization on Docker with X11 Forwarding (#11729)

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Gereziher Adhane <gereziherw@gmail.com>
Co-authored-by: Francesco Mattioli <Francesco.mttl@gmail.com>
Co-authored-by: Burhan <62214284+Burhan-Q@users.noreply.github.com>
This commit is contained in:
João Fonseca 2024-05-17 13:18:45 +01:00 committed by GitHub
parent bd5016211f
commit 06ff89b404
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 108 additions and 3 deletions

View file

@ -535,7 +535,8 @@ def check_imshow(warn=False):
"""Check if environment supports image displays."""
try:
if LINUX:
assert "DISPLAY" in os.environ and not IS_DOCKER and not IS_COLAB and not IS_KAGGLE
assert not IS_COLAB and not IS_KAGGLE
assert "DISPLAY" in os.environ, "The DISPLAY environment variable isn't set."
cv2.imshow("test", np.zeros((8, 8, 3), dtype=np.uint8)) # show a small 8-pixel image
cv2.waitKey(1)
cv2.destroyAllWindows()