From cde7a9f5d7b835d6505b40cb5a91dcb66fd85f44 Mon Sep 17 00:00:00 2001 From: Lakshantha Dissanayake Date: Mon, 25 Nov 2024 07:45:19 -0800 Subject: [PATCH] Improve `is_jetson` to support more Jetson devices (#17770) Co-authored-by: UltralyticsAssistant Co-authored-by: Glenn Jocher --- ultralytics/utils/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ultralytics/utils/__init__.py b/ultralytics/utils/__init__.py index b6d620fd..f02e148b 100644 --- a/ultralytics/utils/__init__.py +++ b/ultralytics/utils/__init__.py @@ -607,13 +607,12 @@ def is_raspberrypi() -> bool: def is_jetson() -> bool: """ - Determines if the Python environment is running on a Jetson Nano or Jetson Orin device by checking the device model - information. + Determines if the Python environment is running on an NVIDIA Jetson device by checking the device model information. Returns: - (bool): True if running on a Jetson Nano or Jetson Orin, False otherwise. + (bool): True if running on an NVIDIA Jetson device, False otherwise. """ - return "NVIDIA" in PROC_DEVICE_MODEL # i.e. "NVIDIA Jetson Nano" or "NVIDIA Orin NX" + return any(keyword in PROC_DEVICE_MODEL.lower() for keyword in ("nvidia", "jetson")) def is_online() -> bool: