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:facenet [2024/10/28 21:12] louis |
products:sbc:vim4:npu:demos:facenet [2025/01/08 22:31] (current) louis |
||
---|---|---|---|
Line 1: | Line 1: | ||
~~tag> NPU FaceNet VIM4 PyTorch~~ | ~~tag> NPU FaceNet VIM4 PyTorch~~ | ||
+ | |||
+ | **Doc for version ddk-3.4.7.7** | ||
+ | |||
====== FaceNet PyTorch VIM4 Demo - 6 ====== | ====== FaceNet PyTorch VIM4 Demo - 6 ====== | ||
Line 23: | Line 26: | ||
``` | ``` | ||
- | ===== Get Convert Tool ===== | + | ==== Get Convert Tool ==== |
+ | |||
+ | Download Tool from [[gh> | ||
```shell | ```shell | ||
$ git lfs install | $ git lfs install | ||
- | $ git lfs clone https://gitlab.com/ | + | $ git lfs clone https://github.com/ |
$ cd vim4_npu_sdk | $ cd vim4_npu_sdk | ||
$ ls | $ ls | ||
- | adla-toolkit-binary | + | adla-toolkit-binary |
``` | ``` | ||
Line 37: | Line 42: | ||
* '' | * '' | ||
- | ==== Get conversion tool ==== | + | <WRAP important> |
+ | If your kernel is older than 241129, please use branch npu-ddk-1.7.5.5. | ||
+ | </ | ||
- | Download Tool from [[gl> | + | ==== Convert ==== |
- | + | ||
- | ```shell | + | |
- | $ git clone https:// | + | |
- | ``` | + | |
After training model, modify '' | After training model, modify '' | ||
Line 98: | 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 122: | 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 147: | Line 154: | ||
# Run mode 1 | # Run mode 1 | ||
- | $ sudo ./facenet -m ../ | + | $ ./facenet -m ../ |
``` | ``` | ||
Line 154: | Line 161: | ||
```shell | ```shell | ||
# Run mode 2 | # Run mode 2 | ||
- | $ sudo ./facenet -m ../ | + | $ ./facenet -m ../ |
``` | ``` | ||
+ | {{: | ||
+ | |||
+ | Here are two comparison methods, **Euclidean distance** and **cosine similarity**. | ||
+ | |||
+ | **Euclidean distance** is smaller, more similar between two faces. | ||
+ | |||
+ | **Cosine similarity** is closer to 1, more similar between two faces. |