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)
- Host: GitHub
- URL: https://github.com/qengineering/yolov5-npu-multithread
- Owner: Qengineering
- License: bsd-3-clause
- Created: 2024-12-17T12:36:16.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-12-24T16:58:04.000Z (10 months ago)
- Last Synced: 2025-06-21T17:10:22.537Z (4 months ago)
- Topics: deep-, multithreading, npu, rk3566, rk3568, rk3588, rock5c, yolov5
- Language: C++
- Homepage: https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html
- Size: 32.6 MB
- Stars: 19
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YoloV5 NPU Multithread (200 FPS)

## YoloV5 for RK3566/68/88 NPU (Rock 5, Orange Pi 5, Radxa Zero 3).
[](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.------------
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CPZTM5BB3FCYL)