0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Raspberry Pi 5で YOLO11(v8.3.157)を動かす

Posted at
  • Raspberry Pi 5 8GB
  • logicool C270N
  • microSDXC 64GB
  • Raspberry Pi OS(64-bit)(Release date:May 3th 2025)

YOLO11のインストール

sudo rm /usr/lib/python3.11/EXTERNALLY-MANAGED
sudo pip3 install ultralytics==8.3.157

Successfully installed
 filelock-3.18.0
 fsspec-2025.5.1
 mpmath-1.3.0
 networkx-3.5
 opencv-python-4.11.0.86
 pandas-2.3.0
 py-cpuinfo-9.0.0
 pyyaml-6.0.2
 sympy-1.14.0
 torch-2.7.1
 torchvision-0.22.1
 typing-extensions-4.14.0
 tzdata-2025.2
 ultralytics-8.3.158
 ultralytics-thop-2.0.14

onnxruntimeのインストール

sudo pip3 install onnxruntime

参考:
https://misoji-engineer.com/archives/raspberry-pi-onnx-yolox.html
https://docs.ultralytics.com/ja/integrations/onnx/

ONNXフォーマットにエクスポート

yolo export model=best.pt format=onnx half=True dynamic=True device=cpu

best.pt:Google Colabでトレーニングしたモデル
half=True:モデルサイズの縮小
dynamic=True:ダイナミックな画像サイズに対応
device=cpu:デバイスをCPUに指定

YOLO11の動作確認

yolo task=detect mode=predict model=best.onnx source=0 show=True imgsz=256

Raspberry Pi 5:1 frame:20.6ms(48.5fps)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?