在RPi5和CM4上使用rpi ai kit运行yolov8s的基准测试
介绍
YOLOv8(You Only Look Once version 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
适用于 Raspberry Pi 5
运行此项目
- Pi5 Benchmark
- CM4 基准测试
在 RPi5 上安装 AI kit
请参考此文档
安装 Hailo 软件并验证安装
更新系统
sudo apt update
sudo apt full-upgrade
Set pcie to gen2/gen3(gen3 is faster than gen2)
Add following text to /boot/firmware/config.txt
#Enable the PCIe external connector
dtparam=pciex1
#Force Gen 3.0 speeds
dtparam=pciex1_gen=3
如果您想使用 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
正确的结果如下所示:
在 Raspberry Pi5 上打开终端,输入以下命令检查 hailo-8L 是否已连接。
lspci | grep Hailo
正确的结果如下所示:
运行项目
- 运行姿态估计
- 运行目标检测
安装项目
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 the project
# run pose estimation with AI kit
bash run.sh pose-estimation-hailo
# run pose estimation without AI kit
bash run.sh pose-estimation
结果
安装项目
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 the project
# run object detection with AI kit
bash run.sh object-detection-hailo
# run object detection without AI kit
bash run.sh object-detection
结果
对于目标检测,请参考以下wiki: yolov8_object_detection_on_recomputer_r1000_with_hailo_8l
对于姿态估计,请参考以下wiki: yolov8_pose_estimation_on_recomputer_r1000_with_hailo_8l
结果
- batchsize=8
- batchsize=1
技术支持与产品讨论
感谢您选择我们的产品!我们在这里为您提供不同的支持,以确保您使用我们产品的体验尽可能顺畅。我们提供多种沟通渠道,以满足不同的偏好和需求。