RK3568使用NPU实现YOLOv5s目标检测
源代码
ls -l external/rknpu2/examples/rknn_yolov5_demo/
total 52
-rw-r--r-- 1 i2som i2som 4082 Apr 16 2024 CMakeLists.txt
-rw-r--r-- 1 i2som i2som 3479 Apr 16 2024 README.md
-rwxr-xr-x 1 i2som i2som 739 Apr 16 2024 build-android_RK3562.sh
-rwxr-xr-x 1 i2som i2som 739 Apr 16 2024 build-android_RK3566_RK3568.sh
-rwxr-xr-x 1 i2som i2som 739 Apr 16 2024 build-android_RK3588.sh
-rwxr-xr-x 1 i2som i2som 487 Apr 16 2024 build-linux_RK3562.sh
-rwxr-xr-x 1 i2som i2som 487 Apr 16 2024 build-linux_RK3566_RK3568.sh
-rwxr-xr-x 1 i2som i2som 487 Apr 16 2024 build-linux_RK3588.sh
drwxr-xr-x 3 i2som i2som 4096 Apr 16 2024 convert_rknn_demo
drwxr-xr-x 2 i2som i2som 4096 Apr 16 2024 include
drwxr-xr-x 6 i2som i2som 4096 Apr 16 2024 model
drwxr-xr-x 2 i2som i2som 4096 Apr 16 2024 src
drwxr-xr-x 2 i2som i2som 4096 Apr 16 2024 utils
安装aarch64编译器
sudo apt install gcc-8-aarch64-linux-gnu g++-aarch64-linux-gnu
编译rknn_yolov5_video_demo例程
cd external/rknpu2/examples/rknn_yolov5_video_demo/
./build-linux_RK3566_RK3568.sh
编译后的文件在install目录下
tree install/
install/
`-- rknn_yolov5_demo_Linux
|-- lib
| |-- libmk_api.so
| |-- librga.so
| |-- librknnrt.so
| `-- librockchip_mpp.so -> librockchip_mpp.so.1
|-- model
| |-- bus.jpg
| |-- coco_80_labels_list.txt
| |-- RK3562
| | `-- yolov5s-640-640.rknn
| |-- RK3566_RK3568
| | `-- yolov5s-640-640.rknn
| |-- RK3588
| | `-- yolov5s-640-640.rknn
| `-- RV110X
| `-- yolov5s-640-640.rknn
|-- rknn_yolov5_demo
`-- rknn_yolov5_video_demo
编译后,将install目录下完全拷贝到开发板系统内。
在开发板上执行程序来测试test.mp4视频画面内容的检测。
$ cd rknn_yolov5_demo_Linux/
$ ./rknn_yolov5_demo model/RK3566_RK3568/yolov5s-640-640.rknn test.mp4