An open API service indexing awesome lists of open source software.

https://github.com/qengineering/yolov5-npu-multithread

YoloV5 NPU multithread for the RK3566/68/88 (200 FPS)
https://github.com/qengineering/yolov5-npu-multithread

deep- multithreading npu rk3566 rk3568 rk3588 rock5c yolov5

Last synced: about 15 hours ago
JSON representation

YoloV5 NPU multithread for the RK3566/68/88 (200 FPS)

Awesome Lists containing this project

README

          

# YoloV5 NPU Multithread (200 FPS)

![Screenshot from 2024-12-17 12-46-03](https://github.com/user-attachments/assets/96072118-8567-4f1f-a90c-451d08bd2526)

## YoloV5 for RK3566/68/88 NPU (Rock 5, Orange Pi 5, Radxa Zero 3).

[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)


Paper: https://towardsdatascience.com/yolo-v5-is-here-b668ce2a4908


Special made for the NPU, see [Q-engineering deep learning examples](https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html)

------------

**This example is unsuitable for use with a camera.**

**Typically, cameras operate at a maximum of 30 FPS, a rate most NPU models can easily handle within a single thread.**

------------

## Dependencies.
To run the application, you have to:
- OpenCV 64-bit installed.
- Optional: Code::Blocks. (```$ sudo apt-get install codeblocks```)

### Installing the dependencies.
Start with the usual
```
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install cmake wget curl
```
#### OpenCV
Follow the Raspberry Pi 4 [guide](https://qengineering.eu/install-opencv-on-raspberry-64-os.html).

#### RKNPU2
```
$ git clone https://github.com/airockchip/rknn-toolkit2.git
```
We only use a few files.
```
rknn-toolkit2-master
│  
└── rknpu2
│  
└── runtime
│  
└── Linux
│  
└── librknn_api
   ├── aarch64
   │   └── librknnrt.so
   └── include
   ├── rknn_api.h
   ├── rknn_custom_op.h
   └── rknn_matmul_api.h

$ cd ~/rknn-toolkit2-master/rknpu2/runtime/Linux/librknn_api/aarch64
$ sudo cp ./librknnrt.so /usr/local/lib
$ cd ~/rknn-toolkit2-master/rknpu2/runtime/Linux/librknn_api/include
$ sudo cp ./rknn_* /usr/local/include
```
Save 2 GB of disk space by removing the toolkit. We do not need it anymore.
```
$ cd ~
$ sudo rm -rf ./rknn-toolkit2-master
```

------------

## Installing the app.
To extract and run the network in Code::Blocks

```
$ mkdir *MyDir*

$ cd *MyDir*

$ git clone https://github.com/Qengineering/YoloV5-NPU.git

```

------------

## Running the app.
You can use **Code::Blocks**.
- Load the project file *.cbp in Code::Blocks.
- Select _Release_, not Debug.
- Compile and run with F9.
- You can alter command line arguments with _Project -> Set programs arguments..._

Or use **Cmake**.
```
$ cd *MyDir*
$ mkdir build
$ cd build
$ cmake ..
$ make -j4
```
Make sure you use the model fitting your system.

------------

[![paypal](https://qengineering.eu/images/TipJarSmall4.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CPZTM5BB3FCYL)