-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1409 from LJ-Hao/docusaurus-version
Add:benchmark_on_rpi5_and_cm4_running_yolov8s_with_rpi_ai_kit
- Loading branch information
Showing
4 changed files
with
267 additions
and
6 deletions.
There are no files selected for viewing
256 changes: 256 additions & 0 deletions
256
...ns/Computer-Vision/benchmark_on_rpi5_and_cm4_running_yolov8s_with_rpi_ai_kit.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,256 @@ | ||
--- | ||
description: This wiki demonstrates yolov8s pose estimation and object detection benchmark on Raspberry Pi5 and Raspberry Pi Compute Module 4. | ||
title: Benchmark on RPi5 and CM4 running yolov8s with rpi ai kit | ||
keywords: | ||
- Edge | ||
- reComputer r1000 | ||
- Object detecton | ||
image: https://files.seeedstudio.com/wiki/wiki-platform/S-tempor.png | ||
slug: /benchmark_on_rpi5_and_cm4_running_yolov8s_with_rpi_ai_kit | ||
last_update: | ||
date: 07/17/2024 | ||
author: Jiahao | ||
|
||
no_comments: false # for Disqus | ||
--- | ||
|
||
# Benchmark on RPi5 and CM4 running yolov8s with rpi ai kit | ||
|
||
## Introduction | ||
|
||
[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. | ||
|
||
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. | ||
|
||
|
||
## Prepare Hardware | ||
|
||
### For CM4 | ||
|
||
<div class="table-center"> | ||
<table align="center"> | ||
<tr> | ||
<th>reComputer r1000</th> | ||
<th>Raspberry Pi AI Kit</th> | ||
</tr> | ||
<tr> | ||
<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> | ||
<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> | ||
</tr> | ||
<tr> | ||
<td><div class="get_one_now_container" style={{textAlign: 'center'}}> | ||
<a class="get_one_now_item" href="https://www.seeedstudio.com/reComputer-R1000-Series-Optional-Accessories.html"> | ||
<strong><span><font color={'FFFFFF'} size={"4"}> Get One Now 🖱️</font></span></strong> | ||
</a> | ||
</div></td> | ||
<td><div class="get_one_now_container" style={{textAlign: 'center'}}> | ||
<a class="get_one_now_item" href="https://www.seeedstudio.com/Raspberry-Pi-AI-Kit-p-5900.html"> | ||
<strong><span><font color={'FFFFFF'} size={"4"}> Get One Now 🖱️</font></span></strong> | ||
</a> | ||
</div></td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
### For Raspberry Pi 5 | ||
|
||
<div class="table-center"> | ||
<table align="center"> | ||
<tr> | ||
<th>Raspberry Pi5 8GB</th> | ||
<th>Raspberry Pi AI Kit</th> | ||
</tr> | ||
<tr> | ||
<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> | ||
<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> | ||
</tr> | ||
<tr> | ||
<td><div class="get_one_now_container" style={{textAlign: 'center'}}> | ||
<a class="get_one_now_item" href="https://www.seeedstudio.com/Raspberry-Pi-5-8GB-p-5810.html"> | ||
<strong><span><font color={'FFFFFF'} size={"4"}> Get One Now 🖱️</font></span></strong> | ||
</a> | ||
</div></td> | ||
<td><div class="get_one_now_container" style={{textAlign: 'center'}}> | ||
<a class="get_one_now_item" href="https://www.seeedstudio.com/Raspberry-Pi-AI-Kit-p-5900.html"> | ||
<strong><span><font color={'FFFFFF'} size={"4"}> Get One Now 🖱️</font></span></strong> | ||
</a> | ||
</div></td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
|
||
## Run this project | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
<Tabs> | ||
<TabItem value="Method 1" label="CM4 Benchmark"> | ||
|
||
For object detection please refer to the following wiki: | ||
[yolov8_object_detection_on_recomputer_r1000_with_hailo_8l](http://localhost:3000/yolov8_object_detection_on_recomputer_r1000_with_hailo_8l/) | ||
|
||
For pose estimation Please refer to the following wiki: | ||
[yolov8_pose_estimation_on_recomputer_r1000_with_hailo_8l](http://localhost:3000/yolov8_pose_estimation_on_recomputer_r1000_with_hailo_8l/) | ||
</TabItem> | ||
|
||
<TabItem value="Method 2" label="Pi5 Benchmark"> | ||
|
||
### Install AI kit on RPi5 | ||
Please refer to [this](https://www.raspberrypi.com/documentation/accessories/ai-kit.html) | ||
|
||
### Install Hailo Software & Verify Installation | ||
|
||
#### update the system: | ||
|
||
``` | ||
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 | ||
``` | ||
:::note | ||
If you want to use gen2,please comment dtparam=pciex1_gen=3 | ||
::: | ||
|
||
#### Install hailo-all and reboot: | ||
|
||
Open terminal on the Raspberry Pi5, and input command as follows to install Hailo software. | ||
|
||
``` | ||
sudo apt install hailo-all | ||
sudo reboot | ||
``` | ||
#### Check Software and Hardware: | ||
|
||
Open terminal on the Raspberry Pi5, and input command as follows to check if hailo-all have been installed. | ||
|
||
``` | ||
hailortcli fw-control identify | ||
``` | ||
|
||
The right result show as bellow: | ||
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/check_software.png" alt="pir" width={1000} height="auto"/></p> | ||
|
||
Open terminal on the Raspberry Pi5, and input command as follows to check if hailo-8L have been connected. | ||
|
||
``` | ||
lspci | grep Hailo | ||
``` | ||
|
||
The right result show as bellow: | ||
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/YOLOV8/check_hardware.png" alt="pir" width={1000} height="auto"/></p> | ||
|
||
Open terminal on the reCompuer R1000, and input command as follows to run YOLOv8. | ||
|
||
### Run Project | ||
|
||
|
||
|
||
<Tabs> | ||
<TabItem value="Method 1" label="Run pose estimation"> | ||
|
||
#### Install Project | ||
|
||
``` | ||
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 | ||
``` | ||
|
||
#### Result | ||
|
||
<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> | ||
|
||
|
||
</TabItem> | ||
|
||
<TabItem value="Method 2" label="Run object detection"> | ||
|
||
#### Install Project | ||
|
||
``` | ||
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 | ||
``` | ||
|
||
#### Result | ||
|
||
<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> | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
|
||
## Result | ||
|
||
### object detection | ||
|
||
<Tabs> | ||
<TabItem value="Method 1" label="Object Detection Benchmark"> | ||
|
||
<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> | ||
|
||
</TabItem> | ||
|
||
<TabItem value="Method 2" label="Pose Estimation Benchmark"> | ||
|
||
<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> | ||
|
||
</TabItem> | ||
|
||
</Tabs> | ||
|
||
## Tech Support & Product Discussion | ||
|
||
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. | ||
|
||
<div class="button_tech_support_container"> | ||
<a href="https://forum.seeedstudio.com/" class="button_forum"></a> | ||
<a href="https://www.seeedstudio.com/contacts" class="button_email"></a> | ||
</div> | ||
|
||
<div class="button_tech_support_container"> | ||
<a href="https://discord.gg/eWkprNDMU7" class="button_discord"></a> | ||
<a href="https://github.com/Seeed-Studio/wiki-documents/discussions/69" class="button_discussion"></a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters