Model Conversion

Note: Using the Docker container in the factory image does not require re-setting up the environment. The environment is already set up. Simply enter Docker and run the corresponding function commands according to the previous tutorial.

1. Raspberry Pi 5 YOLO11 (Benchmark)

YOLO11 benchmark data comes from the Ultralytics team, and is tested on models in various formats (data for reference only).

Officially, only YOLO11n and YOLO11s models were benchmarked. Other models are too large to run on Raspberry Pis and may not provide good performance.

image-20250815143614729

2. Model Conversion

**Conversion cannot be performed on the Jetson Nano board in Docker because the PyTorch/Ultralytics dependencies are too new and the CPU/GPU instruction sets are incompatible. You can first export to TensorRT/ONNX on a Raspberry Pi or PC, then run it on the Jetson Nano:

Based on the test parameters for different model formats provided by the Ultralytics team, we found that using TensorRT for inference performance is the best!

2.1. CLI: pt → onnx, pt → ncnn

Convert the PyTorch model to onnx and ncnn

Run the following command in the terminal:

image-20250815143843821

image-20250815143904321

2.2. Python: pt → onnx → ncnn

Converting a PyTorch model to TensorRT: The conversion process automatically generates an ONNX model.

image-20250815144129965

Sample code:

3. Model Prediction

CLI Usage

Currently, the CLI only supports USB camera calls!

image-20250815144250221

image-20250815144319483

References

https://docs.ultralytics.com/guides/nvidia-pi/

https://docs.ultralytics.com/integrations/tensorrt/