Paper: https://towardsdatascience.com/yolo-v5-is-here-b668ce2a4908
Special made for the NPU, see Q-engineering deep learning examples
To run the application, you have to:
- OpenCV 64-bit installed.
- Optional: Code::Blocks. (
$ sudo apt-get install codeblocks
)
Start with the usual
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install cmake wget curl
Follow the Raspberry Pi 4 guide.
$ 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
To extract and run the network in Code::Blocks
$ mkdir *MyDir* <br/>
$ cd *MyDir* <br/>
$ git clone https://github.com/Qengineering/YoloV5-NPU.git <br/>
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.