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>
pull/17765/head^2
Lakshantha Dissanayake 3 days ago committed by GitHub
parent 0727b43ca6
commit cde7a9f5d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      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:

Loading…
Cancel
Save