Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim4:npu:demos:retinaface

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:demos:retinaface [2023/09/20 01:13]
hyphop ↷ Page moved from products:sbc:vim4:npu:npu-demos:retinaface to products:sbc:vim4:npu:demos:retinaface
products:sbc:vim4:npu:demos:retinaface [2025/01/08 22:29] (current)
louis
Line 1: Line 1:
 ~~tag> NPU RetinaFace VIM4 PyTorch~~ ~~tag> NPU RetinaFace VIM4 PyTorch~~
 +
 +**Doc for version ddk-3.4.7.7**
  
 ====== RetinaFace PyTorch VIM4 Demo - 5 ====== ====== RetinaFace PyTorch VIM4 Demo - 5 ======
Line 34: Line 36:
 Follow Docker official documentation to install Docker: [[https://docs.docker.com/engine/install/ubuntu/|Install Docker Engine on Ubuntu]]. Follow Docker official documentation to install Docker: [[https://docs.docker.com/engine/install/ubuntu/|Install Docker Engine on Ubuntu]].
  
-Then fetch the prebuilt NPU Docker container and run it.+Follow the script below to get Docker image:
  
 ```shell ```shell
-docker pull yanwyb/npu:v1 +docker pull numbqq/npu-vim4
-$ docker run -it --name vim4-npu1 -v $(pwd):/home/khadas/npu \ +
- -v /etc/localtime:/etc/localtime:ro \ +
- -v /etc/timezone:/etc/timezone:ro \ +
- yanwyb/npu:v1+
 ``` ```
  
-==== Get conversion tool ====+==== Get Convert Tool ====
  
-Download Tool from [[gl>khadas/vim4_npu_sdk]].+Download Tool from [[gh>khadas/vim4_npu_sdk]].
  
 ```shell ```shell
-$ git clone https://gitlab.com/khadas/vim4_npu_sdk+$ git lfs install 
 +$ git lfs clone https://github.com/khadas/vim4_npu_sdk 
 +$ cd vim4_npu_sdk 
 +$ ls 
 +adla-toolkit-binary  adla-toolkit-binary-3.1.7.4  convert-in-docker.sh  Dockerfile  docs  README.md
 ``` ```
 +
 +  * ''adla-toolkit-binary/docs'' - SDK documentations
 +  * ''adla-toolkit-binary/bin'' - SDK tools required for model conversion
 +  * ''adla-toolkit-binary/demo'' - Conversion examples
 +
 +<WRAP important>
 +If your kernel is older than 241129, please use branch npu-ddk-1.7.5.5.
 +</WRAP>
  
 ==== Convert ==== ==== Convert ====
Line 91: Line 101:
         --dtypes "float32" \         --dtypes "float32" \
         --inference-input-type float32 \         --inference-input-type float32 \
- --inference-output-type float32 \+ --inference-output-type float32 \
         --quantize-dtype int8 --outdir onnx_output  \         --quantize-dtype int8 --outdir onnx_output  \
         --channel-mean-value "0,0,0,255"  \         --channel-mean-value "0,0,0,255"  \
Line 115: Line 125:
 $ git clone https://github.com/khadas/vim4_npu_applications $ git clone https://github.com/khadas/vim4_npu_applications
 ``` ```
 +
 +<WRAP important>
 +If your kernel is older than 241129, please use version before tag ddk-3.4.7.7.
 +</WRAP>
  
 ==== Install dependencies ==== ==== Install dependencies ====
Line 138: Line 152:
  
 # Run # Run
-sudo ./retinaface -m ../data/retinaface_int8.adla -p ../data/timg.jpg+$ ./retinaface -m ../data/retinaface_int8.adla -p ../data/timg.jpg
 ``` ```
 +
 +{{:products:sbc:vim4:npu:demos:retinaface-demo-output.webp?800|}}
  
 === Camera input demo === === Camera input demo ===
  
 Put ''retinaface_int8.adla'' in ''vim4_npu_applications/retinaface_cap/data/''. Put ''retinaface_int8.adla'' in ''vim4_npu_applications/retinaface_cap/data/''.
 +
 +== Compile ==
  
 ```shell ```shell
-# Compile +$ cd vim4_npu_applications/face_recognition_cap
-$ cd vim4_npu_applications/retinaface_cap+
 $ mkdir build $ mkdir build
 $ cd build $ cd build
 $ cmake .. $ cmake ..
 $ make $ make
 +```
  
-Run +== Run== 
-sudo ./retinaface_cap -m ../data/retinaface_int8.adla -d 0 -w 1920 -h 1080+ 
 +**MIPI Camera** 
 + 
 +``` 
 +$ ./retinaface_cap -m ../data/retinaface_int8.adla -t mipi 
 +``` 
 + 
 +**USB Camera** 
 +``` 
 +$ cd build 
 +$ ./retinaface_cap -m ../data/retinaface_int8.adla -t usb -d 0
 ``` ```
  
-''0'' is the camera device index.+**TIP**: Replace as the number for your camera device. Such as ''/dev/video5'', it should be ''-d 5''.
  
Last modified: 2023/09/20 01:13 by hyphop