Merge branch 'main' into train_preprocess_fix

train_preprocess_fix
Muhammad Rizwan Munawar 1 month ago committed by GitHub
commit 3e48edcff6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      .github/workflows/stale.yml
  2. 216
      docs/en/guides/nvidia-jetson.md
  3. 2
      ultralytics/__init__.py
  4. 2
      ultralytics/models/sam/predict.py
  5. 1
      ultralytics/nn/autobackend.py

@ -5,6 +5,10 @@ on:
schedule:
- cron: "0 0 * * *" # Runs at 00:00 UTC every day
permissions:
pull-requests: write
issues: write
jobs:
stale:
runs-on: ubuntu-latest

@ -1,12 +1,12 @@
---
comments: true
description: Learn to deploy Ultralytics YOLOv8 on NVIDIA Jetson devices with our detailed guide. Explore performance benchmarks and maximize AI capabilities.
keywords: Ultralytics, YOLOv8, NVIDIA Jetson, JetPack, AI deployment, performance benchmarks, embedded systems, deep learning, TensorRT, computer vision
description: Learn to deploy Ultralytics YOLO11 on NVIDIA Jetson devices with our detailed guide. Explore performance benchmarks and maximize AI capabilities.
keywords: Ultralytics, YOLO11, NVIDIA Jetson, JetPack, AI deployment, performance benchmarks, embedded systems, deep learning, TensorRT, computer vision
---
# Quick Start Guide: NVIDIA Jetson with Ultralytics YOLOv8
# Quick Start Guide: NVIDIA Jetson with Ultralytics YOLO11
This comprehensive guide provides a detailed walkthrough for deploying Ultralytics YOLOv8 on [NVIDIA Jetson](https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/) devices. Additionally, it showcases performance benchmarks to demonstrate the capabilities of YOLOv8 on these small and powerful devices.
This comprehensive guide provides a detailed walkthrough for deploying Ultralytics YOLO11 on [NVIDIA Jetson](https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/) devices. Additionally, it showcases performance benchmarks to demonstrate the capabilities of YOLO11 on these small and powerful devices.
<p align="center">
<br>
@ -16,7 +16,7 @@ This comprehensive guide provides a detailed walkthrough for deploying Ultralyti
allowfullscreen>
</iframe>
<br>
<strong>Watch:</strong> How to Setup NVIDIA Jetson with Ultralytics YOLOv8
<strong>Watch:</strong> How to Setup NVIDIA Jetson with Ultralytics YOLO11
</p>
<img width="1024" src="https://github.com/ultralytics/docs/releases/download/0/nvidia-jetson-ecosystem.avif" alt="NVIDIA Jetson Ecosystem">
@ -77,7 +77,7 @@ The below table highlights NVIDIA JetPack versions supported by different NVIDIA
## Quick Start with Docker
The fastest way to get started with Ultralytics YOLOv8 on NVIDIA Jetson is to run with pre-built docker images for Jetson. Refer to the table above and choose the JetPack version according to the Jetson device you own.
The fastest way to get started with Ultralytics YOLO11 on NVIDIA Jetson is to run with pre-built docker images for Jetson. Refer to the table above and choose the JetPack version according to the Jetson device you own.
=== "JetPack 4"
@ -242,7 +242,7 @@ Out of all the model export formats supported by Ultralytics, TensorRT delivers
### Convert Model to TensorRT and Run Inference
The YOLOv8n model in PyTorch format is converted to TensorRT to run inference with the exported model.
The YOLO11n model in PyTorch format is converted to TensorRT to run inference with the exported model.
!!! example
@ -251,14 +251,14 @@ The YOLOv8n model in PyTorch format is converted to TensorRT to run inference wi
```python
from ultralytics import YOLO
# Load a YOLOv8n PyTorch model
model = YOLO("yolov8n.pt")
# Load a YOLO11n PyTorch model
model = YOLO("yolo11n.pt")
# Export the model to TensorRT
model.export(format="engine") # creates 'yolov8n.engine'
model.export(format="engine") # creates 'yolo11n.engine'
# Load the exported TensorRT model
trt_model = YOLO("yolov8n.engine")
trt_model = YOLO("yolo11n.engine")
# Run inference
results = trt_model("https://ultralytics.com/images/bus.jpg")
@ -267,11 +267,11 @@ The YOLOv8n model in PyTorch format is converted to TensorRT to run inference wi
=== "CLI"
```bash
# Export a YOLOv8n PyTorch model to TensorRT format
yolo export model=yolov8n.pt format=engine # creates 'yolov8n.engine'
# Export a YOLO11n PyTorch model to TensorRT format
yolo export model=yolo11n.pt format=engine # creates 'yolo11n.engine'
# Run inference with the exported model
yolo predict model=yolov8n.engine source='https://ultralytics.com/images/bus.jpg'
yolo predict model=yolo11n.engine source='https://ultralytics.com/images/bus.jpg'
```
### Use NVIDIA Deep Learning Accelerator (DLA)
@ -292,14 +292,14 @@ The following Jetson devices are equipped with DLA hardware:
```python
from ultralytics import YOLO
# Load a YOLOv8n PyTorch model
model = YOLO("yolov8n.pt")
# Load a YOLO11n PyTorch model
model = YOLO("yolo11n.pt")
# Export the model to TensorRT with DLA enabled (only works with FP16 or INT8)
model.export(format="engine", device="dla:0", half=True) # dla:0 or dla:1 corresponds to the DLA cores
# Load the exported TensorRT model
trt_model = YOLO("yolov8n.engine")
trt_model = YOLO("yolo11n.engine")
# Run inference
results = trt_model("https://ultralytics.com/images/bus.jpg")
@ -308,119 +308,119 @@ The following Jetson devices are equipped with DLA hardware:
=== "CLI"
```bash
# Export a YOLOv8n PyTorch model to TensorRT format with DLA enabled (only works with FP16 or INT8)
yolo export model=yolov8n.pt format=engine device="dla:0" half=True # dla:0 or dla:1 corresponds to the DLA cores
# Export a YOLO11n PyTorch model to TensorRT format with DLA enabled (only works with FP16 or INT8)
yolo export model=yolo11n.pt format=engine device="dla:0" half=True # dla:0 or dla:1 corresponds to the DLA cores
# Run inference with the exported model on the DLA
yolo predict model=yolov8n.engine source='https://ultralytics.com/images/bus.jpg'
yolo predict model=yolo11n.engine source='https://ultralytics.com/images/bus.jpg'
```
!!! note
Visit the [Export page](../modes/export.md#arguments) to access additional arguments when exporting models to different model formats
## NVIDIA Jetson Orin YOLOv8 Benchmarks
## NVIDIA Jetson Orin YOLO11 Benchmarks
YOLOv8 benchmarks were run by the Ultralytics team on 10 different model formats measuring speed and [accuracy](https://www.ultralytics.com/glossary/accuracy): PyTorch, TorchScript, ONNX, OpenVINO, TensorRT, TF SavedModel, TF GraphDef, TF Lite, PaddlePaddle, NCNN. Benchmarks were run on Seeed Studio reComputer J4012 powered by Jetson Orin NX 16GB device at FP32 [precision](https://www.ultralytics.com/glossary/precision) with default input image size of 640.
YOLO11 benchmarks were run by the Ultralytics team on 10 different model formats measuring speed and [accuracy](https://www.ultralytics.com/glossary/accuracy): PyTorch, TorchScript, ONNX, OpenVINO, TensorRT, TF SavedModel, TF GraphDef, TF Lite, PaddlePaddle, NCNN. Benchmarks were run on Seeed Studio reComputer J4012 powered by Jetson Orin NX 16GB device at FP32 [precision](https://www.ultralytics.com/glossary/precision) with default input image size of 640.
### Comparison Chart
Even though all model exports are working with NVIDIA Jetson, we have only included **PyTorch, TorchScript, TensorRT** for the comparison chart below because, they make use of the GPU on the Jetson and are guaranteed to produce the best results. All the other exports only utilize the CPU and the performance is not as good as the above three. You can find benchmarks for all exports in the section after this chart.
<div style="text-align: center;">
<img width="800" src="https://github.com/ultralytics/docs/releases/download/0/nvidia-jetson-ecosystem-2.avif" alt="NVIDIA Jetson Ecosystem">
<img src="https://github.com/ultralytics/docs/releases/download/0/nvidia-jetson-benchmarks.avif" alt="NVIDIA Jetson Ecosystem">
</div>
### Detailed Comparison Table
The below table represents the benchmark results for five different models (YOLOv8n, YOLOv8s, YOLOv8m, YOLOv8l, YOLOv8x) across ten different formats (PyTorch, TorchScript, ONNX, OpenVINO, TensorRT, TF SavedModel, TF GraphDef, TF Lite, PaddlePaddle, NCNN), giving us the status, size, mAP50-95(B) metric, and inference time for each combination.
The below table represents the benchmark results for five different models (YOLO11n, YOLO11s, YOLO11m, YOLO11l, YOLO11x) across ten different formats (PyTorch, TorchScript, ONNX, OpenVINO, TensorRT, TF SavedModel, TF GraphDef, TF Lite, PaddlePaddle, NCNN), giving us the status, size, mAP50-95(B) metric, and inference time for each combination.
!!! performance
=== "YOLOv8n"
=== "YOLO11n"
| Format | Status | Size on disk (MB) | mAP50-95(B) | Inference time (ms/im) |
|-----------------|--------|-------------------|-------------|------------------------|
| PyTorch | ✅ | 6.2 | 0.6381 | 14.3 |
| TorchScript | ✅ | 12.4 | 0.6117 | 13.3 |
| ONNX | ✅ | 12.2 | 0.6092 | 70.6 |
| OpenVINO | ✅ | 12.3 | 0.6092 | 104.2 |
| TensorRT (FP32) | ✅ | 16.1 | 0.6091 | 8.01 |
| TensorRT (FP16) | ✅ | 9.2 | 0.6093 | 4.55 |
| TensorRT (INT8) | ✅ | 5.9 | 0.2759 | 4.09 |
| TF SavedModel | ✅ | 30.6 | 0.6092 | 141.74 |
| TF GraphDef | ✅ | 12.3 | 0.6092 | 199.93 |
| TF Lite | ✅ | 12.3 | 0.6092 | 349.18 |
| PaddlePaddle | ✅ | 24.4 | 0.6030 | 555 |
| NCNN | ✅ | 12.2 | 0.6092 | 32 |
=== "YOLOv8s"
| PyTorch | ✅ | 5.4 | 0.6176 | 19.80 |
| TorchScript | ✅ | 10.5 | 0.6100 | 13.30 |
| ONNX | ✅ | 10.2 | 0.6082 | 67.92 |
| OpenVINO | ✅ | 10.4 | 0.6082 | 118.21 |
| TensorRT (FP32) | ✅ | 14.1 | 0.6100 | 7.94 |
| TensorRT (FP16) | ✅ | 8.3 | 0.6082 | 4.80 |
| TensorRT (INT8) | ✅ | 6.6 | 0.3256 | 4.17 |
| TF SavedModel | ✅ | 25.8 | 0.6082 | 185.88 |
| TF GraphDef | ✅ | 10.3 | 0.6082 | 256.66 |
| TF Lite | ✅ | 10.3 | 0.6082 | 284.64 |
| PaddlePaddle | ✅ | 20.4 | 0.6082 | 477.41 |
| NCNN | ✅ | 10.2 | 0.6106 | 32.18 |
=== "YOLO11s"
| Format | Status | Size on disk (MB) | mAP50-95(B) | Inference time (ms/im) |
|-----------------|--------|-------------------|-------------|------------------------|
| PyTorch | ✅ | 21.5 | 0.6967 | 18 |
| TorchScript | ✅ | 43.0 | 0.7136 | 23.81 |
| ONNX | ✅ | 42.8 | 0.7136 | 185.55 |
| OpenVINO | ✅ | 42.9 | 0.7136 | 243.97 |
| TensorRT (FP32) | ✅ | 46.4 | 0.7136 | 14.01 |
| TensorRT (FP16) | ✅ | 24.2 | 0.722 | 7.16 |
| TensorRT (INT8) | ✅ | 13.7 | 0.4233 | 5.49 |
| TF SavedModel | ✅ | 107 | 0.7136 | 260.03 |
| TF GraphDef | ✅ | 42.8 | 0.7136 | 423.4 |
| TF Lite | ✅ | 42.8 | 0.7136 | 1046.64 |
| PaddlePaddle | ✅ | 85.5 | 0.7140 | 1464 |
| NCNN | ✅ | 42.7 | 0.7200 | 63 |
=== "YOLOv8m"
| PyTorch | ✅ | 18.4 | 0.7526 | 20.20 |
| TorchScript | ✅ | 36.5 | 0.7416 | 23.42 |
| ONNX | ✅ | 36.3 | 0.7416 | 162.01 |
| OpenVINO | ✅ | 36.4 | 0.7416 | 159.61 |
| TensorRT (FP32) | ✅ | 40.3 | 0.7416 | 13.93 |
| TensorRT (FP16) | ✅ | 21.7 | 0.7416 | 7.47 |
| TensorRT (INT8) | ✅ | 13.6 | 0.3179 | 5.66 |
| TF SavedModel | ✅ | 91.1 | 0.7416 | 316.46 |
| TF GraphDef | ✅ | 36.4 | 0.7416 | 506.71 |
| TF Lite | ✅ | 36.4 | 0.7416 | 842.97 |
| PaddlePaddle | ✅ | 72.5 | 0.7416 | 1172.57 |
| NCNN | ✅ | 36.2 | 0.7419 | 66.00 |
=== "YOLO11m"
| Format | Status | Size on disk (MB) | mAP50-95(B) | Inference time (ms/im) |
|-----------------|--------|-------------------|-------------|------------------------|
| PyTorch | ✅ | 49.7 | 0.7370 | 36.4 |
| TorchScript | ✅ | 99.2 | 0.7285 | 53.58 |
| ONNX | ✅ | 99 | 0.7280 | 452.09 |
| OpenVINO | ✅ | 99.1 | 0.7280 | 544.36 |
| TensorRT (FP32) | ✅ | 102.4 | 0.7285 | 31.51 |
| TensorRT (FP16) | ✅ | 52.6 | 0.7324 | 14.88 |
| TensorRT (INT8) | ✅ | 28.6 | 0.3283 | 10.89 |
| TF SavedModel | ✅ | 247.5 | 0.7280 | 543.65 |
| TF GraphDef | ✅ | 99 | 0.7280 | 906.63 |
| TF Lite | ✅ | 99 | 0.7280 | 2758.08 |
| PaddlePaddle | ✅ | 197.9 | 0.7280 | 3678 |
| NCNN | ✅ | 98.9 | 0.7260 | 135 |
=== "YOLOv8l"
| PyTorch | ✅ | 38.8 | 0.7595 | 36.70 |
| TorchScript | ✅ | 77.3 | 0.7643 | 50.95 |
| ONNX | ✅ | 76.9 | 0.7643 | 416.34 |
| OpenVINO | ✅ | 77.1 | 0.7643 | 370.99 |
| TensorRT (FP32) | ✅ | 81.5 | 0.7640 | 30.49 |
| TensorRT (FP16) | ✅ | 42.2 | 0.7658 | 14.93 |
| TensorRT (INT8) | ✅ | 24.3 | 0.4118 | 10.32 |
| TF SavedModel | ✅ | 192.7 | 0.7643 | 597.08 |
| TF GraphDef | ✅ | 77.0 | 0.7643 | 1016.12 |
| TF Lite | ✅ | 77.0 | 0.7643 | 2494.60 |
| PaddlePaddle | ✅ | 153.8 | 0.7643 | 3218.99 |
| NCNN | ✅ | 76.8 | 0.7691 | 192.77 |
=== "YOLO11l"
| Format | Status | Size on disk (MB) | mAP50-95(B) | Inference time (ms/im) |
|-----------------|--------|-------------------|-------------|------------------------|
| PyTorch | ✅ | 83.7 | 0.7768 | 61.3 |
| TorchScript | ✅ | 167.2 | 0.7554 | 87.9 |
| ONNX | ✅ | 166.8 | 0.7551 | 852.29 |
| OpenVINO | ✅ | 167 | 0.7551 | 1012.6 |
| TensorRT (FP32) | ✅ | 170.5 | 0.7554 | 49.79 |
| TensorRT (FP16) | ✅ | 86.1 | 0.7535 | 22.89 |
| TensorRT (INT8) | ✅ | 46.4 | 0.4048 | 14.61 |
| TF SavedModel | ✅ | 417.2 | 0.7551 | 990.45 |
| TF GraphDef | ✅ | 166.9 | 0.7551 | 1649.86 |
| TF Lite | ✅ | 166.9 | 0.7551 | 5652.37 |
| PaddlePaddle | ✅ | 333.6 | 0.7551 | 7114.67 |
| NCNN | ✅ | 166.8 | 0.7685 | 231.9 |
=== "YOLOv8x"
| PyTorch | ✅ | 49.0 | 0.7475 | 47.6 |
| TorchScript | ✅ | 97.6 | 0.7250 | 66.36 |
| ONNX | ✅ | 97.0 | 0.7250 | 532.58 |
| OpenVINO | ✅ | 97.3 | 0.7250 | 477.55 |
| TensorRT (FP32) | ✅ | 101.6 | 0.7250 | 38.71 |
| TensorRT (FP16) | ✅ | 52.6 | 0.7265 | 19.35 |
| TensorRT (INT8) | ✅ | 31.6 | 0.3856 | 13.50 |
| TF SavedModel | ✅ | 243.3 | 0.7250 | 895.24 |
| TF GraphDef | ✅ | 97.2 | 0.7250 | 1301.19 |
| TF Lite | ✅ | 97.2 | 0.7250 | 3202.93 |
| PaddlePaddle | ✅ | 193.9 | 0.7250 | 4206.98 |
| NCNN | ✅ | 96.9 | 0.7252 | 225.75 |
=== "YOLO11x"
| Format | Status | Size on disk (MB) | mAP50-95(B) | Inference time (ms/im) |
|-----------------|--------|-------------------|-------------|------------------------|
| PyTorch | ✅ | 130.5 | 0.7759 | 93 |
| TorchScript | ✅ | 260.7 | 0.7472 | 135.1 |
| ONNX | ✅ | 260.4 | 0.7479 | 1296.13 |
| OpenVINO | ✅ | 260.6 | 0.7479 | 1502.15 |
| TensorRT (FP32) | ✅ | 264.0 | 0.7469 | 80.01 |
| TensorRT (FP16) | ✅ | 133.3 | 0.7513 | 40.76 |
| TensorRT (INT8) | ✅ | 70.2 | 0.4277 | 22.08 |
| TF SavedModel | ✅ | 651.1 | 0.7479 | 1451.76 |
| TF GraphDef | ✅ | 260.5 | 0.7479 | 4029.36 |
| TF Lite | ✅ | 260.4 | 0.7479 | 8772.86 |
| PaddlePaddle | ✅ | 520.8 | 0.7479 | 10619.53 |
| NCNN | ✅ | 260.4 | 0.7646 | 376.38 |
| PyTorch | ✅ | 109.3 | 0.8288 | 85.60 |
| TorchScript | ✅ | 218.1 | 0.8308 | 121.67 |
| ONNX | ✅ | 217.5 | 0.8308 | 1073.14 |
| OpenVINO | ✅ | 217.8 | 0.8308 | 955.60 |
| TensorRT (FP32) | ✅ | 221.6 | 0.8307 | 75.84 |
| TensorRT (FP16) | ✅ | 113.1 | 0.8295 | 35.75 |
| TensorRT (INT8) | ✅ | 62.2 | 0.4783 | 22.23 |
| TF SavedModel | ✅ | 545.0 | 0.8308 | 1497.40 |
| TF GraphDef | ✅ | 217.8 | 0.8308 | 2552.42 |
| TF Lite | ✅ | 217.8 | 0.8308 | 7044.58 |
| PaddlePaddle | ✅ | 434.9 | 0.8308 | 8386.73 |
| NCNN | ✅ | 217.3 | 0.8304 | 486.36 |
[Explore more benchmarking efforts by Seeed Studio](https://www.seeedstudio.com/blog/2023/03/30/yolov8-performance-benchmarks-on-nvidia-jetson-devices) running on different versions of NVIDIA Jetson hardware.
@ -435,25 +435,25 @@ To reproduce the above Ultralytics benchmarks on all export [formats](../modes/e
```python
from ultralytics import YOLO
# Load a YOLOv8n PyTorch model
model = YOLO("yolov8n.pt")
# Load a YOLO11n PyTorch model
model = YOLO("yolo11n.pt")
# Benchmark YOLOv8n speed and accuracy on the COCO8 dataset for all all export formats
# Benchmark YOLO11n speed and accuracy on the COCO8 dataset for all all export formats
results = model.benchmarks(data="coco8.yaml", imgsz=640)
```
=== "CLI"
```bash
# Benchmark YOLOv8n speed and accuracy on the COCO8 dataset for all all export formats
yolo benchmark model=yolov8n.pt data=coco8.yaml imgsz=640
# Benchmark YOLO11n speed and accuracy on the COCO8 dataset for all all export formats
yolo benchmark model=yolo11n.pt data=coco8.yaml imgsz=640
```
Note that benchmarking results might vary based on the exact hardware and software configuration of a system, as well as the current workload of the system at the time the benchmarks are run. For the most reliable results use a dataset with a large number of images, i.e. `data='coco8.yaml' (4 val images), or `data='coco.yaml'` (5000 val images).
## Best Practices when using NVIDIA Jetson
When using NVIDIA Jetson, there are a couple of best practices to follow in order to enable maximum performance on the NVIDIA Jetson running YOLOv8.
When using NVIDIA Jetson, there are a couple of best practices to follow in order to enable maximum performance on the NVIDIA Jetson running YOLO11.
1. Enable MAX Power Mode
@ -486,29 +486,29 @@ When using NVIDIA Jetson, there are a couple of best practices to follow in orde
## Next Steps
Congratulations on successfully setting up YOLOv8 on your NVIDIA Jetson! For further learning and support, visit more guide at [Ultralytics YOLOv8 Docs](../index.md)!
Congratulations on successfully setting up YOLO11 on your NVIDIA Jetson! For further learning and support, visit more guide at [Ultralytics YOLO11 Docs](../index.md)!
## FAQ
### How do I deploy Ultralytics YOLOv8 on NVIDIA Jetson devices?
### How do I deploy Ultralytics YOLO11 on NVIDIA Jetson devices?
Deploying Ultralytics YOLOv8 on NVIDIA Jetson devices is a straightforward process. First, flash your Jetson device with the NVIDIA JetPack SDK. Then, either use a pre-built Docker image for quick setup or manually install the required packages. Detailed steps for each approach can be found in sections [Quick Start with Docker](#quick-start-with-docker) and [Start with Native Installation](#start-with-native-installation).
Deploying Ultralytics YOLO11 on NVIDIA Jetson devices is a straightforward process. First, flash your Jetson device with the NVIDIA JetPack SDK. Then, either use a pre-built Docker image for quick setup or manually install the required packages. Detailed steps for each approach can be found in sections [Quick Start with Docker](#quick-start-with-docker) and [Start with Native Installation](#start-with-native-installation).
### What performance benchmarks can I expect from YOLOv8 models on NVIDIA Jetson devices?
### What performance benchmarks can I expect from YOLO11 models on NVIDIA Jetson devices?
YOLOv8 models have been benchmarked on various NVIDIA Jetson devices showing significant performance improvements. For example, the TensorRT format delivers the best inference performance. The table in the [Detailed Comparison Table](#detailed-comparison-table) section provides a comprehensive view of performance metrics like mAP50-95 and inference time across different model formats.
YOLO11 models have been benchmarked on various NVIDIA Jetson devices showing significant performance improvements. For example, the TensorRT format delivers the best inference performance. The table in the [Detailed Comparison Table](#detailed-comparison-table) section provides a comprehensive view of performance metrics like mAP50-95 and inference time across different model formats.
### Why should I use TensorRT for deploying YOLOv8 on NVIDIA Jetson?
### Why should I use TensorRT for deploying YOLO11 on NVIDIA Jetson?
TensorRT is highly recommended for deploying YOLOv8 models on NVIDIA Jetson due to its optimal performance. It accelerates inference by leveraging the Jetson's GPU capabilities, ensuring maximum efficiency and speed. Learn more about how to convert to TensorRT and run inference in the [Use TensorRT on NVIDIA Jetson](#use-tensorrt-on-nvidia-jetson) section.
TensorRT is highly recommended for deploying YOLO11 models on NVIDIA Jetson due to its optimal performance. It accelerates inference by leveraging the Jetson's GPU capabilities, ensuring maximum efficiency and speed. Learn more about how to convert to TensorRT and run inference in the [Use TensorRT on NVIDIA Jetson](#use-tensorrt-on-nvidia-jetson) section.
### How can I install PyTorch and Torchvision on NVIDIA Jetson?
To install PyTorch and Torchvision on NVIDIA Jetson, first uninstall any existing versions that may have been installed via pip. Then, manually install the compatible PyTorch and Torchvision versions for the Jetson's ARM64 architecture. Detailed instructions for this process are provided in the [Install PyTorch and Torchvision](#install-pytorch-and-torchvision) section.
### What are the best practices for maximizing performance on NVIDIA Jetson when using YOLOv8?
### What are the best practices for maximizing performance on NVIDIA Jetson when using YOLO11?
To maximize performance on NVIDIA Jetson with YOLOv8, follow these best practices:
To maximize performance on NVIDIA Jetson with YOLO11, follow these best practices:
1. Enable MAX Power Mode to utilize all CPU and GPU cores.
2. Enable Jetson Clocks to run all cores at their maximum frequency.

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
__version__ = "8.3.23"
__version__ = "8.3.24"
import os

@ -478,7 +478,7 @@ class Predictor(BasePredictor):
results = []
for masks, orig_img, img_path in zip([pred_masks], orig_imgs, self.batch[0]):
if len(masks) == 0:
masks = None
masks, pred_bboxes = None, torch.zeros((0, 6), device=pred_masks.device)
else:
masks = ops.scale_masks(masks[None].float(), orig_img.shape[:2], padding=False)[0]
masks = masks > self.model.mask_threshold # to bool

@ -345,6 +345,7 @@ class AutoBackend(nn.Module):
model_path=w,
experimental_delegates=[load_delegate(delegate, options={"device": device})],
)
device = "cpu" # Required, otherwise PyTorch will try to use the wrong device
else: # TFLite
LOGGER.info(f"Loading {w} for TensorFlow Lite inference...")
interpreter = Interpreter(model_path=w) # load TFLite model

Loading…
Cancel
Save