This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
products:sbc:vim3:npu:npu-prebuilt-demo-usage [2022/09/16 03:26] ivan |
products:sbc:vim3:npu:npu-prebuilt-demo-usage [2023/09/11 09:58] (current) hyphop |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ~~tag> | ||
+ | |||
====== NPU Prebuilt Demo Usage ====== | ====== NPU Prebuilt Demo Usage ====== | ||
- | <WRAP tip > | + | Prebuilt example demos for interacting with the Amlogic |
- | - Please follow this docs to upgrade | + | |
- | - Just support Opencv4 | + | |
- | </ | + | |
- | ===== install | + | ===== Install |
- | + | Update your system and install the OpenCV packages. | |
- | ```sh Install-OpenCV4.sh | + | ```shell |
- | sudo apt install libopencv-dev python3-opencv | + | $ sudo apt update |
+ | $ sudo apt install libopencv-dev python3-opencv | ||
``` | ``` | ||
===== Get NPU Demo ===== | ===== Get NPU Demo ===== | ||
- | < | + | /* |
- | NPU Demo is not installed on the board by default. You need to download it from github | + | < |
+ | The NPU Demo is not installed on the board by default. You need to download it from GitHub | ||
</ | </ | ||
+ | */ | ||
- | 1) Clone to the board through the git command. | + | Get the demo source: [[gh> |
- | + | ```shell | |
- | ```sh get-npu-demo-from-demo.sh | + | $ git clone --recursive https:// |
- | cd {workspace} | + | |
- | git clone --recursive https:// | + | |
``` | ``` | ||
- | 2) Or download the compressed package directly, and then unzip it to the board. | ||
- | There are three directories in NPU Demo: | + | The NPU demo contains three examples: |
- | < | + | - '' |
- | | + | - '' |
- | < | + | - '' |
- | | + | |
- | < | + | |
- | | + | |
- | </ | + | |
===== Inception Model ===== | ===== Inception Model ===== | ||
+ | The inception model does not have any library dependencies and can be used as is. | ||
- | - The inception model does not need to install any libraries into the system. | + | Enter the '' |
- | - imagenet_slim_labels.txt is a label file. After the result is identified, the label corresponding to the result can be queried in this file. | + | |
+ | ```shell | ||
+ | $ cd aml_npu_demo_binaries/ | ||
+ | $ ls | ||
+ | dog_299x299.jpg | ||
+ | ``` | ||
- | $ cd {workspace}/ | + | '' |
- | $ ls | + | |
- | | + | |
- | < | + | < |
- | If your board is VIM3, enter the VIM3 directory, if it is VIM3L, then enter the VIM3L directory. Here is VIM3 as an example. | + | Depending on your board, enter the VIM3 or VIM3L directory |
</ | </ | ||
- | 1 | + | ```shell |
- | | + | $ ls aml_npu_demo_binaries/ |
- | + | $ inceptionv3 | |
- | | + | $ cd aml_npu_demo_binaries/ |
- | | + | $ ./run.sh |
- | | + | Create Neural Network: 59ms or 59022us |
- | | + | Verify... |
- | | + | Verify Graph: 0ms or 739us |
- | | + | Start run graph [1] times... |
- | | + | Run the 1 time: 20.00ms or 20497.00us |
- | | + | vxProcessGraph execution time: |
- | | + | Total |
- | | + | Average 20.54ms or 20540.00us |
- | | + | --- Top5 --- |
- | | + | 2: 0.833984 |
- | | + | 795: 0.009102 |
- | + | 974: 0.003592 | |
- | 14 974: 0.003592 | + | 408: 0.002207 |
- | | + | 393: 0.002111 |
- | | + | ``` |
- | + | ||
<WRAP Info> | <WRAP Info> | ||
| | ||
- | By querying imagenet_slim_labels.txt, | + | By querying |
</ | </ | ||
===== Yolo Series Model ===== | ===== Yolo Series Model ===== | ||
- | |||
- | ==== Preparation ==== | ||
- | |||
- | The application of the yolo series model is divided into two parts: camera dynamic recognition and image recognition. | ||
==== Install and uninstall libraries ==== | ==== Install and uninstall libraries ==== | ||
- | The yolo series models need to install the library into the system. | + | The yolo series models need to install the library into the system. |
- | 1) Install | + | You can follow the steps to either install or uninstall the libraries. |
- | ```sh install-libraries.sh | + | Install libraries: |
- | cd {workspace}/ | + | |
- | sudo ./INSTALL | + | ```shell |
+ | $ cd aml_npu_demo_binaries/ | ||
+ | $ sudo ./INSTALL | ||
``` | ``` | ||
- | 2) Uninstall | ||
- | ```sh uninstall-libraries.sh | + | Uninstall libraries: |
- | cd {workspace}/ | + | |
- | sudo ./UNINSTALL | + | ```shell |
+ | $ cd aml_npu_demo_binaries/ | ||
+ | $ sudo ./UNINSTALL | ||
``` | ``` | ||
- | ==== type Parameter Description ==== | + | |
+ | ==== Type Parameter Description ==== | ||
<WRAP important > | <WRAP important > | ||
- | The type parameter is an input parameter that must be selected whether it is to use camera dynamic recognition or to recognize pictures. This parameter is mainly used to specify the running | + | The type parameter is an input parameter that must be selected whether it is to use camera dynamic recognition or to recognize pictures. This parameter is mainly used to specify the running |
</ | </ | ||
- | 1 | + | ```shell |
- | | + | 0 : yoloface model |
- | | + | 1 : yolov2 model |
- | | + | 2 : yolov3 model |
- | | + | 3 : yolov3_tiny model |
- | + | 4 : yolov4 model | |
- | ==== Operating Environment | + | ``` |
+ | |||
+ | ==== Operating Environment | ||
| | ||
- | NPU Demo can run in X11 or framebuffer mode, just select the corresponding demo to run. | + | NPU Demo can run in X11 Desktop |
- | === X11 / Framebuffer === | + | - The demo with fb is running in framebuffer mode. |
+ | - The demo with x11 is running in X11 mode. | ||
- | - The demo with fb is running in framebuffer mode. | + | ==== Demo examples ==== |
+ | === detect_demo_picture === | ||
- | - The demo with x11 is running in X11 mode. | + | ```shell |
+ | $ cd aml_npu_demo_binaries/ | ||
+ | $ ls | ||
+ | 1080p.bmp detect_demo_x11 | ||
+ | ``` | ||
+ | == Run == | ||
- | ==== Illustrative Example ==== | + | Command format of the picture. |
- | Here is an example of detect_demo_picture, | + | ```shell |
+ | $ cd aml_npu_demo_binaries/ | ||
+ | $ ./ | ||
+ | ``` | ||
+ | Here is an example of using OpenCV4 to call the '' | ||
- | ```sh detect-demo-picture-example.sh | + | ```shell |
- | $ cd {workspace}/ | + | $ cd aml_npu_demo_binaries/ |
- | $ ls | + | $ ./ |
- | 1080p.bmp | + | |
``` | ``` | ||
- | <WRAP tip > | ||
- | - detect_demo_fb It is a demo that uses opencv4 recognition pictures running under framebuffer | ||
- | - detect_demo_x11 It is a demo that uses opencv4 recognition pictures running under X11 | ||
- | </ | ||
- | ==== Run ==== | + | The results of the operation are as follows. |
- | Identify the command format of the picture. | + | {{: |
- | $ cd {workspace}/ | + | === detect_demo === |
- | $ ./ | + | |
- | Here is an example | + | <WRAP tip > |
+ | You should use the demo of usb to use the USB camera, and the demo of mipi to use the mipi camera. | ||
+ | </ | ||
- | $ cd {workspace}/ | + | == Run == |
- | | + | Command format for camera dynamic recognition. |
- | The results | + | ```shell |
+ | $ cd aml_npu_demo_binaries/ | ||
+ | $ ./ | ||
+ | ``` | ||
+ | |||
+ | Here is an example | ||
+ | ```shell | ||
+ | $ cd aml_npu_demo_binaries/ | ||
+ | $ ./ | ||
+ | ``` | ||
- | {{ : | + | < |
- | + | After turning on the camera, the recognition result will be displayed on the screen. | |
- | < | + | |
- | Camera description | + | |
- | - You should use the demo of usb to use the USB camera, | + | |
- | - Command format for camera dynamic recognition | + | |
</ | </ | ||
+ | {{: |