Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim4:npu:npu-applications

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:vim4:npu:npu-applications [2023/06/06 06:38]
nick
products:sbc:vim4:npu:npu-applications [2025/03/17 01:45] (current)
nick [Install dependences]
Line 1: Line 1:
-====== VIM4 NPU Applications ======+~~tags>VIM4 NPU~~ 
 + 
 +**Doc for version ddk-3.4.7.7** 
 + 
 +====== NPU Applications ====== 
 + 
 +{{indexmenu_n>1}}
  
 <WRAP important > <WRAP important >
Line 5: Line 11:
 </WRAP> </WRAP>
  
-==== Linux ====+===== Linux =====
  
 <WRAP important > <WRAP important >
-Only supports OpenCV4+Only supports OpenCV4.
 </WRAP> </WRAP>
  
-==== Install OpenCV4 ====+==== Get source code ====
  
-```shell +You need to download the source code to your VIM4 board and compile on it.
-$ sudo apt update +
-$ sudo apt install libopencv-dev python3-opencv +
-``` +
- +
-==== Source Code for Applications ====+
  
 Clone the NPU demo applications to somewhere, e.g. ''~/workspace'': Clone the NPU demo applications to somewhere, e.g. ''~/workspace'':
Line 28: Line 29:
 $ cd vim4_npu_applications $ cd vim4_npu_applications
 $ ls $ ls
-mobilenet_v2  nn_sdk  yolov3  yolov3_cap+densenet_ctc  facenet  face_recognition  face_recognition_cap  retinaface  retinaface_cap  vgg16  yolov3  yolov3_cap  yolov7_tiny  yolov7_tiny_cap  yolov8n  yolov8n_cap
 ``` ```
-  * ''mobilenet_v2''/''yolov3''/''yolov3_cap'': Different demo for VIM4 NPU. +  * ''densenet_ctc'', ''facenet'', ''retinaface'', ''yolov3''''yolov7_tiny''''yolov8n'' - Different demo for VIM4 NPU.
-  * ''nn_sdk'': Dependencies required for compilation.+
  
 +<WRAP important>
 +Please use convert tool version tag ddk-3.4.7.7 or higher.
 +</WRAP>
  
-==== Compile ==== +==== Install dependences ====
- +
-All demos are made based on the ''cmake'' tool.+
  
 ```shell ```shell
-$ sudo apt install cmake+$ sudo apt update 
 +$ sudo apt install -y libopencv-dev python3-opencv cmake
 ``` ```
  
-Take ''mobilenet_v2'' as an example, other demos are the same.+==== Compile ==== 
 + 
 +Take ''yolov3'' as an example, other demos are the same.
  
 ```shell ```shell
-$ cd mobilenet_v2+$ cd yolov3
 $ mkdir build && cd build $ mkdir build && cd build
 $ cmake .. $ cmake ..
Line 52: Line 56:
  
 ==== Run ==== ==== Run ====
- 
-=== Mobilenet V2 === 
- 
-```shell 
-$ cd mobilenet_v2/build 
-$ sudo ./mobilenetv2 ../data/mobilenetv2_int8.adla ../data/goldfish_224x224.jpg  
-[sudo] password for khadas:  
-997: 0.273438 
-886: 0.031250 
-108: 0.023438 
-109: 0.019531 
-127: 0.019531 
-``` 
  
 === Yolov3 === === Yolov3 ===
  
 <WRAP important > <WRAP important >
-The demos of the Yolo series only support running in the desktop environment.+The demos of the Yolo series only support running under the desktop environment.
 </WRAP> </WRAP>
  
-It needs to be edited before running, please refer to the compilation method of ''Mobilenet V2''.+<WRAP tip > 
 +Before running, please compile the source code. The compilation method is same as ''Mobilenet V2''. 
 +</WRAP>
  
-Detect pictures:+Detect picture:
  
 ```shell ```shell
 $ cd yolov3/build $ cd yolov3/build
-sudo ./yolov3 -p ../data/1080p.bmp  -m ../data/det_yolov3_int8.adla+$ ./yolov3 -p ../data/1080p.bmp  -m ../data/det_yolov3_int8.adla
 ``` ```
  
-https://docs.khadas.com/_media/local/dev/vim4/output.webp +{{:products:sbc:vim4:npu:vim4-yolov3-output.webp?1000|}}
-{{:local:dev:vim4:output.png?1000|detect-picture}}+
  
-Detection by camera:+Detection with camera:
  
 ```shell ```shell
 $ cd yolov3_cap/build $ cd yolov3_cap/build
-sudo ./yolov3_cap -m ../data/det_yolov3_int8.adla -d X -w 1920 -h 1080+$ ./yolov3_cap -m ../data/det_yolov3_int8.adla -d X -w 1920 -h 1080
 ``` ```
-**x**: the number for you camera device. such as `/dev/video0``xis `0`. +**x**: the number for you camera device. such as ''/dev/video0''''x'' is ''0''.
  
 +===== Android =====
  
 +WIP:
  
Last modified: 2023/06/06 06:38 by nick