Skip to content

Qengineering/YoloV5-NPU-Multithread

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YoloV5 NPU Multithread (200 FPS)

Screenshot from 2024-12-17 12-46-03

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

License

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

Special made for the NPU, see Q-engineering deep learning examples


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.

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* <br/>
$ cd *MyDir* <br/>
$ git clone https://github.com/Qengineering/YoloV5-NPU.git <br/>

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