Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 1.77 KB

File metadata and controls

45 lines (30 loc) · 1.77 KB

English | 简体中文

SCRFD Python Deployment Example

Two steps before deployment

This directory provides examples that infer.py fast finishes the deployment of SCRFD on RKNPU. The script is as follows

Copy model files

Refer to SCRFD model conversion to convert SCRFD ONNX model to RKNN model and move it to this directory.

Run example

After copying model files, enter the following command to run it: RKNPU2 Python example

# Download the example code for deployment
git clone https://github.com/PaddlePaddle/FastDeploy.git
cd FastDeploy/examples/vision/facedet/scrfd/rknpu2/python

# Download images
wget https://raw.githubusercontent.com/DefTruth/lite.ai.toolkit/main/examples/lite/resources/test_lite_face_detector_3.jpg

# Inference
python3 infer.py --model_file ./scrfd_500m_bnkps_shape640x640_rk3588.rknn \
                 --image test_lite_face_detector_3.jpg

Visualization

The visualized result after running is as follows

Note

The model needs to be in NHWC format on RKNPU. The normalized image will be embedded in the RKNN model. Therefore, when we deploy with FastDeploy, call DisablePermute(C++) or `disable_permute(Python) to disable normalization and data format conversion during preprocessing.

Other Documents