This shows you the differences between two versions of the page.
| 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 [2026/04/02 02:47] (current) nick |
||
|---|---|---|---|
| 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 ====== | ||
| {{indexmenu_n> | {{indexmenu_n> | ||
| + | |||
| + | ===== Introduction ===== | ||
| + | |||
| + | RetinaFace is a face detection model. It can draw five key points on each face, including two eyes, nose and two corners of mouth. | ||
| + | |||
| + | Inference results on VIM4. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | **Inference speed test**: USB camera about **78ms** per frame. | ||
| + | |||
| ===== Get source code ===== | ===== Get source code ===== | ||
| Line 40: | Line 53: | ||
| ``` | ``` | ||
| - | ===== Get Convert Tool ===== | + | ==== Get Convert Tool ==== |
| + | |||
| + | You can find the SDK here: [[dl> | ||
| ```shell | ```shell | ||
| - | $ git lfs install | + | $ wget https://dl.khadas.com/products/ |
| - | $ git lfs clone https://gitlab.com/khadas/ | + | $ tar xvzf vim4_npu_sdk-ddk-3.4.7.7-250508.tgz |
| - | $ cd vim4_npu_sdk | + | $ cd vim4_npu_sdk-ddk-3.4.7.7-250508 |
| $ ls | $ ls | ||
| - | adla-toolkit-binary | + | adla-toolkit-binary |
| ``` | ``` | ||
| - | * '' | + | * '' |
| * '' | * '' | ||
| * '' | * '' | ||
| - | ==== Get conversion | + | * '' |
| - | Download Tool from [[gl>khadas/ | + | <WRAP important> |
| - | + | If your kernel is older than 241129, please use branch npu-ddk-1.7.5.5. | |
| - | ```shell | + | </WRAP> |
| - | $ git clone https:// | + | |
| - | ``` | + | |
| ==== Convert ==== | ==== Convert ==== | ||
| Line 100: | Line 113: | ||
| --dtypes " | --dtypes " | ||
| --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 " | --channel-mean-value " | ||
| Line 124: | Line 137: | ||
| $ git clone https:// | $ git clone https:// | ||
| ``` | ``` | ||
| + | |||
| + | <WRAP important> | ||
| + | If your kernel is older than 241129, please use version before tag ddk-3.4.7.7. | ||
| + | </ | ||
| ==== Install dependencies ==== | ==== Install dependencies ==== | ||
| Line 147: | Line 164: | ||
| # Run | # Run | ||
| - | $ sudo ./ | + | $ ./ |
| ``` | ``` | ||
| Line 153: | Line 170: | ||
| Put '' | Put '' | ||
| + | |||
| + | == Compile == | ||
| ```shell | ```shell | ||
| - | # Compile | + | $ cd vim4_npu_applications/ |
| - | $ cd vim4_npu_applications/ | + | |
| $ mkdir build | $ mkdir build | ||
| $ cd build | $ cd build | ||
| $ cmake .. | $ cmake .. | ||
| $ make | $ make | ||
| + | ``` | ||
| - | # Run | + | == Run== |
| - | $ sudo ./ | + | |
| + | **MIPI Camera** | ||
| + | |||
| + | ``` | ||
| + | $ ./ | ||
| + | ``` | ||
| + | |||
| + | **USB Camera** | ||
| + | ``` | ||
| + | $ cd build | ||
| + | $ ./ | ||
| ``` | ``` | ||
| - | '' | + | **TIP**: Replace |