Amlogic NN Api is a set of NPU Api officially launched by amlogic. This document will introduce how to compile and use khadas to demonstrate based on this set of Api.
API Docs
For detailed information about the API, please refer to the document docs/zh-cn/DDK_6.4.3_SDK_V1.6 API Description.pdf
Compile
Get demo source code
The source code of the aml_npu_nnsdk_app
repository is open on the official gitlab of Khadas
mkdir workspace |
Source code structure introduction
There are currently 3 demos in the source code repository:
- body_pose: Detect 18-point posture of the human body, only support image recognition
- image_classify: Object recognition classification, only supports image recognition
- person_detect: Human body detection, supports image recognition and camera recognition
There are compilation scripts, makefiles and source codes in each directory. Take person_detect as an example.
cd workspace/aml_npu_nnsdk_app/person_detect_640x384 |
- build-cv3.sh : Compiled script
- makefile-cv3.linux : Compilesd makefile
- person_detect_640x384_camera.cpp: Source code for image recognition
- person_detect_640x384_picture.cpp: Source code for camera recognition
Compilation method
Please refer to get SDK #Get-SDK
Here also take person_detect as an example,
cd workspace/aml_npu_nnsdk_app/person_detect_640x384 |
Compilation will generate the generated file in cv3_output
,
cd workspace/aml_npu_nnsdk_app/person_detect_640x384/cv3_output |
Among them, person_detect_640x384_camera
and person_detect_640x384_picture
are the generated executable files
How to Run
Here also take person_detect as an example,
- Obtain the nb file https://github.com/khadas/AML_NN_SDK, the nb file corresponding to
person_detect
is:
mkdir board_space |
Copy the executable file compiled on the PC to the board
Run
Identify the picture
/path/to/person_detect_640x384_picture board_space/person_detect_88.nb /path/to/picture [VIM3] |
Recognition camera
/path/to/person_detect_640x384_camera board_space/person_detect_88.nb /dev/videoX [VIM3] |
Note :
Just a simple template repository, please refer to the documentation for detailed API introduction.