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 [2024/10/28 21:11]
louis
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 40: Line 42:
 ``` ```
  
-===== Get Convert Tool =====+==== Get Convert Tool ==== 
 + 
 +Download Tool from [[gh>khadas/vim4_npu_sdk]].
  
 ```shell ```shell
 $ git lfs install $ git lfs install
-$ git lfs clone https://gitlab.com/khadas/vim4_npu_sdk.git+$ git lfs clone https://github.com/khadas/vim4_npu_sdk
 $ cd vim4_npu_sdk $ cd vim4_npu_sdk
 $ ls $ ls
-adla-toolkit-binary  adla-toolkit-binary-1.2.0. convert-in-docker.sh  Dockerfile  docs  README.md+adla-toolkit-binary  adla-toolkit-binary-3.1.7. convert-in-docker.sh  Dockerfile  docs  README.md
 ``` ```
  
Line 53: Line 57:
   * ''adla-toolkit-binary/bin'' - SDK tools required for model conversion   * ''adla-toolkit-binary/bin'' - SDK tools required for model conversion
   * ''adla-toolkit-binary/demo'' - Conversion examples   * ''adla-toolkit-binary/demo'' - Conversion examples
-==== Get conversion tool ==== 
  
-Download Tool from [[gl>khadas/vim4_npu_sdk]]+<WRAP important> 
- +If your kernel is older than 241129, please use branch npu-ddk-1.7.5.5
-```shell +</WRAP>
-$ git clone https://gitlab.com/khadas/vim4_npu_sdk +
-```+
  
 ==== Convert ==== ==== Convert ====
Line 100: 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 124: 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 147: 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+ 
 +**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: 2024/10/28 21:11 by louis