diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 4cf03a48..2f8c25be 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = "8.3.56" +__version__ = "8.3.57" import os diff --git a/ultralytics/utils/__init__.py b/ultralytics/utils/__init__.py index 126c823a..f5ff78c1 100644 --- a/ultralytics/utils/__init__.py +++ b/ultralytics/utils/__init__.py @@ -524,13 +524,9 @@ def read_device_model() -> str: is_raspberrypi(). Returns: - (str): Model file contents if read successfully or empty string otherwise. + (str): Kernel release information. """ - try: - with open("/proc/device-tree/model") as f: - return f.read() - except Exception: - return "" + return platform.release().lower() def is_ubuntu() -> bool: @@ -602,7 +598,7 @@ def is_raspberrypi() -> bool: Returns: (bool): True if running on a Raspberry Pi, False otherwise. """ - return "Raspberry Pi" in PROC_DEVICE_MODEL + return "rpi" in DEVICE_MODEL def is_jetson() -> bool: @@ -612,7 +608,7 @@ def is_jetson() -> bool: Returns: (bool): True if running on an NVIDIA Jetson device, False otherwise. """ - return any(keyword in PROC_DEVICE_MODEL.lower() for keyword in ("nvidia", "jetson")) + return "tegra" in DEVICE_MODEL def is_online() -> bool: @@ -802,7 +798,7 @@ def get_user_config_dir(sub_dir="Ultralytics"): # Define constants (required below) -PROC_DEVICE_MODEL = read_device_model() # is_jetson() and is_raspberrypi() depend on this constant +DEVICE_MODEL = read_device_model() # is_jetson() and is_raspberrypi() depend on this constant ONLINE = is_online() IS_COLAB = is_colab() IS_KAGGLE = is_kaggle()