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 [2023/09/05 06:13] louis |
products:sbc:vim4:npu:demos:facenet [2024/01/04 21:24] (current) louis old revision restored (2023/09/20 01:13) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ~~tag> NPU FaceNet VIM4 PyTorch~~ |
+ | ====== | ||
+ | {{indexmenu_n> | ||
===== Get Source Code ===== | ===== Get Source Code ===== | ||
+ | |||
+ | [[gh> | ||
```shell | ```shell | ||
- | git clone https:// | + | $ git clone https:// |
``` | ``` | ||
Line 11: | Line 15: | ||
==== Build virtual environment ==== | ==== Build virtual environment ==== | ||
- | Follow Docker official | + | Follow Docker official |
- | Get Docker. | + | Then fetch the prebuilt NPU Docker |
```shell | ```shell | ||
Line 23: | Line 27: | ||
``` | ``` | ||
- | ==== Get convert | + | ==== Get conversion |
- | Download Tool from [[gl> | + | Download Tool from [[gl> |
```shell | ```shell | ||
- | $ git clone https:// | + | $ git clone https:// |
``` | ``` | ||
Line 48: | Line 52: | ||
``` | ``` | ||
- | Create a python | + | Create a Python |
```python export.py | ```python export.py | ||
Line 64: | Line 68: | ||
``` | ``` | ||
- | Enter '' | + | Enter '' |
- | ```shell convert_adla.sh | + | ```bash convert_adla.sh |
#!/bin/bash | #!/bin/bash | ||
| | ||
Line 93: | Line 97: | ||
``` | ``` | ||
- | Run '' | + | Run '' |
```shell | ```shell | ||
Line 99: | Line 103: | ||
``` | ``` | ||
- | ===== Run NPU ===== | + | ===== Run inference on the NPU ===== |
==== Get source code ==== | ==== Get source code ==== | ||
Line 106: | Line 110: | ||
```shell | ```shell | ||
- | $ git clone https:// | + | $ git clone https:// |
``` | ``` | ||
Line 120: | Line 124: | ||
=== Picture input demo === | === Picture input demo === | ||
- | There are two modes of this demo. One is converting face images into feature vectors and saving vectors in face library. Another is comparing input face image with faces in library and outputting Euclidean distance and cosine similarity. | + | There are two modes of this demo. One is converting face images into feature vectors and saving vectors in the face library. Another is comparing input face image with faces in the library and outputting Euclidean distance and cosine similarity. |
Put '' | Put '' | ||
Line 126: | Line 130: | ||
```shell | ```shell | ||
# Compile | # Compile | ||
- | $ cd vim4_npu_applications/ | + | $ cd vim4_npu_applications/ |
$ mkdir build | $ mkdir build | ||
$ cd build | $ cd build | ||
Line 136: | Line 140: | ||
``` | ``` | ||
- | After running mode 1, a file named '' | + | After running mode 1, a file named '' |
```shell | ```shell | ||
# Run mode 2 | # Run mode 2 | ||
- | $ sudo ./facenet -m ../ | + | $ sudo ./facenet -m ../data/model/ |
``` | ``` | ||