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 [2023/09/17 23:03] sravan [Get conversion tool] |
products:sbc:vim4:npu:demos:retinaface [2025/01/08 22:29] (current) louis |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ~~tag> NPU Retinaface | + | ~~tag> NPU RetinaFace |
- | ====== | + | **Doc for version ddk-3.4.7.7** |
+ | |||
+ | ====== | ||
{{indexmenu_n> | {{indexmenu_n> | ||
===== Get source code ===== | ===== Get source code ===== | ||
+ | |||
+ | [[gh> | ||
```shell | ```shell | ||
Line 32: | Line 36: | ||
Follow Docker official documentation to install Docker: [[https:// | Follow Docker official documentation to install Docker: [[https:// | ||
- | Then fetch the prebuilt NPU Docker | + | Follow |
```shell | ```shell | ||
- | $ docker pull yanwyb/npu:v1 | + | docker pull numbqq/npu-vim4 |
- | $ docker run -it --name | + | |
- | -v / | + | |
- | -v / | + | |
- | yanwyb/ | + | |
``` | ``` | ||
- | ==== Get conversion tool ==== | + | ==== Get Convert Tool ==== |
- | Download Tool from [[gl> | + | Download Tool from [[gh> |
```shell | ```shell | ||
- | $ git clone https://gitlab.com/ | + | $ git lfs install |
+ | $ git lfs clone https://github.com/ | ||
+ | $ cd vim4_npu_sdk | ||
+ | $ ls | ||
+ | adla-toolkit-binary | ||
``` | ``` | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | <WRAP important> | ||
+ | If your kernel is older than 241129, please use branch npu-ddk-1.7.5.5. | ||
+ | </ | ||
==== Convert ==== | ==== Convert ==== | ||
- | After training model, we should convert | + | After training |
```python export.py | ```python export.py | ||
Line 89: | Line 101: | ||
--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 98: | Line 110: | ||
``` | ``` | ||
- | Run '' | + | Run '' |
```shell | ```shell | ||
Line 113: | Line 125: | ||
$ 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 136: | Line 152: | ||
# Run | # Run | ||
- | $ sudo ./ | + | $ ./ |
``` | ``` | ||
+ | |||
+ | {{: | ||
=== Camera input demo === | === Camera input demo === | ||
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 0 as the number for your camera device. Such as '' |