Skip to content

Commit 73e6464

Browse files
authored
Merge pull request #1409 from LJ-Hao/docusaurus-version
Add:benchmark_on_rpi5_and_cm4_running_yolov8s_with_rpi_ai_kit
2 parents ad34dfa + 8b91271 commit 73e6464

File tree

4 files changed

+267
-6
lines changed

4 files changed

+267
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
---
2+
description: This wiki demonstrates yolov8s pose estimation and object detection benchmark on Raspberry Pi5 and Raspberry Pi Compute Module 4.
3+
title: Benchmark on RPi5 and CM4 running yolov8s with rpi ai kit
4+
keywords:
5+
- Edge
6+
- reComputer r1000
7+
- Object detecton
8+
image: https://files.seeedstudio.com/wiki/wiki-platform/S-tempor.png
9+
slug: /benchmark_on_rpi5_and_cm4_running_yolov8s_with_rpi_ai_kit
10+
last_update:
11+
date: 07/17/2024
12+
author: Jiahao
13+
14+
no_comments: false # for Disqus
15+
---
16+
17+
# Benchmark on RPi5 and CM4 running yolov8s with rpi ai kit
18+
19+
## Introduction
20+
21+
[YOLOv8](https://github.com/ultralytics/ultralytics) (You Only Look Once version 8) is the popular most YOLO series of real-time pose estimation and object de tection models. It builds upon the strengths of its predecessors by introducing several advancements in speed, accuracy, and flexibility. The [Raspberry-pi-AI-kit](https://www.seeedstudio.com/Raspberry-Pi-AI-Kit-p-5900.html) is used to accelerate inference speed, featuring a 13 tera-operations per second (TOPS) neural network inference accelerator built around the Hailo-8L chip.
22+
23+
This wiki showcases benchmarking of YOLOv8s for pose estimation and object detection on Raspberry Pi 5 and Raspberry Pi Compute Module 4. All tests utilize the same model (YOLOv8s), quantized to int8, with an input size of 640x640 resolution, batch size set to 1, and input from the same video at 240 FPS.
24+
25+
26+
## Prepare Hardware
27+
28+
### For CM4
29+
30+
<div class="table-center">
31+
<table align="center">
32+
<tr>
33+
<th>reComputer r1000</th>
34+
<th>Raspberry Pi AI Kit</th>
35+
</tr>
36+
<tr>
37+
<td><div style={{textAlign:'center'}}><img src="https://media-cdn.seeedstudio.com/media/catalog/product/cache/bb49d3ec4ee05b6f018e93f896b8a25d/1/-/1-113991274-recomputer-r1025-10-0.jpg" style={{width:600, height:'auto'}}/></div></td>
38+
<td><div style={{textAlign:'center'}}><img src="https://media-cdn.seeedstudio.com/media/catalog/product/cache/bb49d3ec4ee05b6f018e93f896b8a25d/2/-/2-113060086-raspberry-pi-ai-kit-all.jpg" style={{width:600, height:'auto'}}/></div></td>
39+
</tr>
40+
<tr>
41+
<td><div class="get_one_now_container" style={{textAlign: 'center'}}>
42+
<a class="get_one_now_item" href="https://www.seeedstudio.com/reComputer-R1000-Series-Optional-Accessories.html">
43+
<strong><span><font color={'FFFFFF'} size={"4"}> Get One Now 🖱️</font></span></strong>
44+
</a>
45+
</div></td>
46+
<td><div class="get_one_now_container" style={{textAlign: 'center'}}>
47+
<a class="get_one_now_item" href="https://www.seeedstudio.com/Raspberry-Pi-AI-Kit-p-5900.html">
48+
<strong><span><font color={'FFFFFF'} size={"4"}> Get One Now 🖱️</font></span></strong>
49+
</a>
50+
</div></td>
51+
</tr>
52+
</table>
53+
</div>
54+
55+
### For Raspberry Pi 5
56+
57+
<div class="table-center">
58+
<table align="center">
59+
<tr>
60+
<th>Raspberry Pi5 8GB</th>
61+
<th>Raspberry Pi AI Kit</th>
62+
</tr>
63+
<tr>
64+
<td><div style={{textAlign:'center'}}><img src="https://media-cdn.seeedstudio.com/media/catalog/product/cache/bb49d3ec4ee05b6f018e93f896b8a25d/2/-/2-102110919-raspberry-pi-5-8gb-font.jpg" style={{width:600, height:'auto'}}/></div></td>
65+
<td><div style={{textAlign:'center'}}><img src="https://media-cdn.seeedstudio.com/media/catalog/product/cache/bb49d3ec4ee05b6f018e93f896b8a25d/2/-/2-113060086-raspberry-pi-ai-kit-all.jpg" style={{width:600, height:'auto'}}/></div></td>
66+
</tr>
67+
<tr>
68+
<td><div class="get_one_now_container" style={{textAlign: 'center'}}>
69+
<a class="get_one_now_item" href="https://www.seeedstudio.com/Raspberry-Pi-5-8GB-p-5810.html">
70+
<strong><span><font color={'FFFFFF'} size={"4"}> Get One Now 🖱️</font></span></strong>
71+
</a>
72+
</div></td>
73+
<td><div class="get_one_now_container" style={{textAlign: 'center'}}>
74+
<a class="get_one_now_item" href="https://www.seeedstudio.com/Raspberry-Pi-AI-Kit-p-5900.html">
75+
<strong><span><font color={'FFFFFF'} size={"4"}> Get One Now 🖱️</font></span></strong>
76+
</a>
77+
</div></td>
78+
</tr>
79+
</table>
80+
</div>
81+
82+
83+
## Run this project
84+
85+
import Tabs from '@theme/Tabs';
86+
import TabItem from '@theme/TabItem';
87+
88+
<Tabs>
89+
<TabItem value="Method 1" label="CM4 Benchmark">
90+
91+
For object detection please refer to the following wiki:
92+
[yolov8_object_detection_on_recomputer_r1000_with_hailo_8l](http://localhost:3000/yolov8_object_detection_on_recomputer_r1000_with_hailo_8l/)
93+
94+
For pose estimation Please refer to the following wiki:
95+
[yolov8_pose_estimation_on_recomputer_r1000_with_hailo_8l](http://localhost:3000/yolov8_pose_estimation_on_recomputer_r1000_with_hailo_8l/)
96+
</TabItem>
97+
98+
<TabItem value="Method 2" label="Pi5 Benchmark">
99+
100+
### Install AI kit on RPi5
101+
Please refer to [this](https://www.raspberrypi.com/documentation/accessories/ai-kit.html)
102+
103+
### Install Hailo Software & Verify Installation
104+
105+
#### update the system:
106+
107+
```
108+
sudo apt update
109+
sudo apt full-upgrade
110+
```
111+
112+
#### Set pcie to gen2/gen3(gen3 is faster than gen2):
113+
114+
Add following text to ```/boot/firmware/config.txt```
115+
116+
```
117+
#Enable the PCIe external connector
118+
119+
dtparam=pciex1
120+
121+
#Force Gen 3.0 speeds
122+
123+
dtparam=pciex1_gen=3
124+
125+
```
126+
:::note
127+
If you want to use gen2,please comment dtparam=pciex1_gen=3
128+
:::
129+
130+
#### Install hailo-all and reboot:
131+
132+
Open terminal on the Raspberry Pi5, and input command as follows to install Hailo software.
133+
134+
```
135+
sudo apt install hailo-all
136+
sudo reboot
137+
```
138+
#### Check Software and Hardware:
139+
140+
Open terminal on the Raspberry Pi5, and input command as follows to check if hailo-all have been installed.
141+
142+
```
143+
hailortcli fw-control identify
144+
```
145+
146+
The right result show as bellow:
147+
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/check_software.png" alt="pir" width={1000} height="auto"/></p>
148+
149+
Open terminal on the Raspberry Pi5, and input command as follows to check if hailo-8L have been connected.
150+
151+
```
152+
lspci | grep Hailo
153+
```
154+
155+
The right result show as bellow:
156+
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/check_hardware.png" alt="pir" width={1000} height="auto"/></p>
157+
158+
Open terminal on the reCompuer R1000, and input command as follows to run YOLOv8.
159+
160+
### Run Project
161+
162+
163+
164+
<Tabs>
165+
<TabItem value="Method 1" label="Run pose estimation">
166+
167+
#### Install Project
168+
169+
```
170+
git clone https://github.com/Seeed-Projects/Benchmarking-YOLOv8-on-Raspberry-PI-reComputer-r1000-and-AIkit-Hailo-8L.git
171+
cd Benchmarking-YOLOv8-on-Raspberry-PI-reComputer-r1000-and-AIkit-Hailo-8L
172+
```
173+
174+
#### Run the project
175+
176+
```
177+
# run pose estimation with AI kit
178+
179+
bash run.sh pose-estimation-hailo
180+
181+
# run pose estimation without AI kit
182+
183+
bash run.sh pose-estimation
184+
```
185+
186+
#### Result
187+
188+
<iframe width="800" height="400" src="https://www.youtube.com/embed/Mo7AL7AjxwA" title="Raspberry Pi AI: YOLOv8 Pose Estimation - 240fps Video Input, Pi 5 PCIe Gen2 vs Gen3 Benchmark" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
189+
190+
191+
</TabItem>
192+
193+
<TabItem value="Method 2" label="Run object detection">
194+
195+
#### Install Project
196+
197+
```
198+
git clone https://github.com/Seeed-Projects/Benchmarking-YOLOv8-on-Raspberry-PI-reComputer-r1000-and-AIkit-Hailo-8L.git
199+
cd Benchmarking-YOLOv8-on-Raspberry-PI-reComputer-r1000-and-AIkit-Hailo-8L
200+
```
201+
202+
#### Run the project
203+
204+
```
205+
# run object detection with AI kit
206+
207+
bash run.sh object-detection-hailo
208+
209+
# run object detection without AI kit
210+
211+
bash run.sh object-detection
212+
```
213+
214+
#### Result
215+
216+
<iframe width="800" height="400" src="https://www.youtube.com/embed/olaSVKmt9YI" title="Raspberry Pi AI: YOLOv8 Object Detection - 240fps Video Input, Pi 5 PCIe Gen2 vs Gen3 Benchmark" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
217+
218+
</TabItem>
219+
</Tabs>
220+
221+
</TabItem>
222+
</Tabs>
223+
224+
225+
## Result
226+
227+
### object detection
228+
229+
<Tabs>
230+
<TabItem value="Method 1" label="Object Detection Benchmark">
231+
232+
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/object-detection-benchmark.png" alt="pir" width={1000} height="auto"/></p>
233+
234+
</TabItem>
235+
236+
<TabItem value="Method 2" label="Pose Estimation Benchmark">
237+
238+
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/pose-estimation-benchmark.png" alt="pir" width={1000} height="auto"/></p>
239+
240+
</TabItem>
241+
242+
</Tabs>
243+
244+
## Tech Support & Product Discussion
245+
246+
Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.
247+
248+
<div class="button_tech_support_container">
249+
<a href="https://forum.seeedstudio.com/" class="button_forum"></a>
250+
<a href="https://www.seeedstudio.com/contacts" class="button_email"></a>
251+
</div>
252+
253+
<div class="button_tech_support_container">
254+
<a href="https://discord.gg/eWkprNDMU7" class="button_discord"></a>
255+
<a href="https://github.com/Seeed-Studio/wiki-documents/discussions/69" class="button_discussion"></a>
256+
</div>
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ hailortcli fw-control identify
116116

117117
The right result show as bellow:
118118

119-
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/check_hardware.png" alt="pir" width={1000} height="auto"/></p>
119+
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/check_software.png" alt="pir" width={1000} height="auto"/></p>
120+
120121

121122
Open terminal on the reCompuer R1000, and input command as follows to check if hailo-8L have been connected.
122123

@@ -125,7 +126,8 @@ lspci | grep Hailo
125126
```
126127

127128
The right result show as bellow:
128-
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/check_software.png" alt="pir" width={1000} height="auto"/></p>
129+
130+
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/check_hardware.png" alt="pir" width={1000} height="auto"/></p>
129131

130132
### Run YOLOv8
131133

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ hailortcli fw-control identify
116116

117117
The right result show as bellow:
118118

119-
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/check_hardware.png" alt="pir" width={1000} height="auto"/></p>
119+
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/check_software.png" alt="pir" width={1000} height="auto"/></p>
120+
120121

121122
Open terminal on the reCompuer R1000, and input command as follows to check if hailo-8L have been connected.
122123

@@ -125,7 +126,8 @@ lspci | grep Hailo
125126
```
126127

127128
The right result show as bellow:
128-
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/check_software.png" alt="pir" width={1000} height="auto"/></p>
129+
130+
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/check_hardware.png" alt="pir" width={1000} height="auto"/></p>
129131

130132
### Run YOLOv8
131133

sidebars.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3014,8 +3014,9 @@ const sidebars = {
30143014
type: 'category',
30153015
label: 'Computer Vision',
30163016
items: [
3017-
'Edge/Raspberry_Pi_Devices/reComputer_R1000/Applications/yolov8_object_detection_on_recomputer_r1000_with_hailo_8l',
3018-
'Edge/Raspberry_Pi_Devices/reComputer_R1000/Applications/yolov8_pose_estimation_on_recomputer_r1000_with_hailo_8l'
3017+
'Edge/Raspberry_Pi_Devices/reComputer_R1000/Applications/Computer-Vision/yolov8_object_detection_on_recomputer_r1000_with_hailo_8l',
3018+
'Edge/Raspberry_Pi_Devices/reComputer_R1000/Applications/Computer-Vision/yolov8_pose_estimation_on_recomputer_r1000_with_hailo_8l',
3019+
'Edge/Raspberry_Pi_Devices/reComputer_R1000/Applications/Computer-Vision/benchmark_on_rpi5_and_cm4_running_yolov8s_with_rpi_ai_kit'
30193020
],
30203021
},
30213022

0 commit comments

Comments
 (0)