Improve is_jetson to support more Jetson devices (#17770)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Lakshantha Dissanayake 2024-11-25 07:45:19 -08:00 committed by GitHub
parent 0727b43ca6
commit cde7a9f5d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: