Use NCNN for yolo on RaspberryPi

2024-12-03 python yolo raspi

Install required library first.

~/venv/bin/pip3 install ncnn

Creates ncnn model using export method.

from ultralytics import YOLO

model = YOLO("yolo11n-pose.pt")
model.export(format="ncnn")

the exported model can be loaded like the below:

model = YOLO('yolo11n-pose_ncnn_model')

After appliyng the new model. the FPS improved to 6 from 2(approx).

https://docs.ultralytics.com/guides/raspberry-pi/#use-ncnn-on-raspberry-pi

In the first trial, tried to use openvino through onnx. However, it was not simple compare to the above. See https://axross-recipe.com/recipes/1368