Skip to content

Latest commit

 

History

History
70 lines (53 loc) · 2.15 KB

File metadata and controls

70 lines (53 loc) · 2.15 KB

English | 简体中文

SCRFD C++ Deployment Example

This directory provides examples that infer.cc fast finishes the deployment of SCRFD on NPU.

Two steps before deployment:

  1. The environment of software and hardware should meet the requirements.
  2. Download the precompiled deployment repo or deploy the FastDeploy repository from scratch according to your development environment.

Refer to RK2 generation NPU deployment repository compilation for the steps above

Generate the base directory file

It consists of the following parts

.
├── CMakeLists.txt
├── build  # Compile folder
├── image  # The folder to save images 
├── infer.cc
├── model  # The folder to save model files
└── thirdpartys  # The folder to save sdk

Generate the directory first

mkdir build
mkdir images
mkdir model
mkdir thirdpartys

Compile

Compile and copy the SDK into the thirdpartys folder

Refer to RK2 generation NPU deployment repository compilation. It will enerate fastdeploy-0.7.0 directory in the build directory after compilation. Move it to the thirdpartys directory.

Copy the model files to the model folder

Refer to SCRFD model conversion to convert SCRFD ONNX model to RKNN model and move it to the model folder.

Prepare test images to the image folder

wget https://github.com/raw/DefTruth/lite.ai.toolkit/main/examples/lite/resources/test_lite_face_detector_3.jpg
cp test_lite_face_detector_3.jpg ./images

Compile example

cd build
cmake ..
make -j8
make install

Running routines

cd ./build/install
export LD_LIBRARY_PATH=${PWD}/lib:${LD_LIBRARY_PATH}
./rknpu_test

The visualized result after running is as follows