Skip to main content

在 RPi5 和 CM4 上使用 rpi ai kit 运行 yolov8s 的基准测试

简介

YOLOv8(You Only Look Once 第 8 版)是最受欢迎的 YOLO 系列实时姿态估计和目标检测模型。它在前代产品的基础上,在速度、精度和灵活性方面引入了多项改进。Raspberry-pi-AI-kit 用于加速推理速度,配备了基于 Hailo-8L 芯片构建的 13 TOPS 神经网络推理加速器。

本 wiki 展示了在 Raspberry Pi 5 和 Raspberry Pi Compute Module 4 上进行 YOLOv8s 姿态估计和目标检测的基准测试。所有测试都使用相同的模型(YOLOv8s),量化为 int8,输入尺寸为 640x640 分辨率,批处理大小设置为 1,并使用来自同一视频的 240 FPS 输入。

准备硬件

适用于 CM4

reComputer r1000Raspberry Pi AI Kit

适用于 Raspberry Pi 5

reComputer AI R2140Raspberry Pi5 8GBRaspberry Pi AI Kit

适用于 Raspberry Pi CM5

reComputer Industrial R20xxreComputer Industrial R21xx

运行此项目

在 RPi5 上安装 AI kit

请参考此处

安装 Hailo 软件并验证安装

更新系统

sudo apt update
sudo apt full-upgrade

设置 pcie 为 gen2/gen3(gen3 比 gen2 更快)

将以下文本添加到 /boot/firmware/config.txt

#Enable the PCIe external connector

dtparam=pciex1

#Force Gen 3.0 speeds

dtparam=pciex1_gen=3

note

如果您想使用 gen2,请注释掉 dtparam=pciex1_gen=3

安装 hailo-all 并重启

在 Raspberry Pi5 上打开终端,输入以下命令来安装 Hailo 软件。

sudo apt install hailo-all
sudo reboot

检查软件和硬件

在 Raspberry Pi5 上打开终端,输入以下命令来检查 hailo-all 是否已安装。

hailortcli fw-control identify

正确的结果如下所示:

pir

在 Raspberry Pi5 上打开终端,输入以下命令来检查 hailo-8L 是否已连接。

lspci | grep Hailo

正确的结果如下所示:

pir

运行项目

安装项目

git clone https://github.com/Seeed-Projects/Benchmarking-YOLOv8-on-Raspberry-PI-reComputer-r1000-and-AIkit-Hailo-8L.git
cd Benchmarking-YOLOv8-on-Raspberry-PI-reComputer-r1000-and-AIkit-Hailo-8L

运行项目

# run pose estimation with AI kit

bash run.sh pose-estimation-hailo

# run pose estimation without AI kit

bash run.sh pose-estimation

结果

结果

pir

pir

技术支持与产品讨论

感谢您选择我们的产品!我们在这里为您提供不同的支持,以确保您使用我们产品的体验尽可能顺畅。我们提供多种沟通渠道,以满足不同的偏好和需求。

Loading Comments...