Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim4:npu:demos:facenet

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:facenet [2023/09/17 23:03]
sravan [Get Source Code]
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~~ +~~tag> NPU FaceNet VIM4 PyTorch~~ 
-====== Facenet Pytorch VIM4 Demo - 6 ======+====== FaceNet PyTorch VIM4 Demo - 6 ======
  
 {{indexmenu_n>6}} {{indexmenu_n>6}}
Line 17: Line 17:
 Follow Docker official documentation to install Docker: [[https://docs.docker.com/engine/install/ubuntu/|Install Docker Engine on Ubuntu]]. Follow Docker official documentation to install Docker: [[https://docs.docker.com/engine/install/ubuntu/|Install Docker Engine on Ubuntu]].
  
-Then fetch the prebuilt NPU Docker Container and run it.+Then fetch the prebuilt NPU Docker container and run it.
  
 ```shell ```shell
Line 29: Line 29:
 ==== Get conversion tool ==== ==== Get conversion tool ====
  
-Download Tool from [[gl>khadas/vim4_npu_sdk.git]].+Download Tool from [[gl>khadas/vim4_npu_sdk]].
  
 ```shell ```shell
-$ git clone https://gitlab.com/khadas/vim4_npu_sdk.git+$ git clone https://gitlab.com/khadas/vim4_npu_sdk
 ``` ```
  
Line 52: Line 52:
 ``` ```
  
-Create a python file written as follows and run to convert model to ONNX.+Create a Python file written as follows and run to convert the model to ONNX.
  
 ```python export.py ```python export.py
Line 97: Line 97:
 ``` ```
  
-Run ''convert_adla.sh'' to generate VIM4 model. The converted model is ''xxx.adla'' in ''onnx_output''.+Run ''convert_adla.sh'' to generate the VIM4 model. The converted model is ''xxx.adla'' in ''onnx_output''.
  
 ```shell ```shell
Line 124: 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 ''facenet_int8.adla'' in ''vim4_npu_applications/facenet/data/''. Put ''facenet_int8.adla'' in ''vim4_npu_applications/facenet/data/''.
Line 130: Line 130:
 ```shell ```shell
 # Compile # Compile
-$ cd vim4_npu_applications/retinaface+$ cd vim4_npu_applications/facenet
 $ mkdir build $ mkdir build
 $ cd build $ cd build
Line 140: Line 140:
 ``` ```
  
-After running mode 1, a file named ''face_feature_lib'' will generate in ''vim4_npu_applications/facenet''Had this file, you can run mode 2.+After running mode 1, a file named ''face_feature_lib'' will generate in ''vim4_npu_applications/facenet''With this file generated, you can run mode 2.
  
 ```shell ```shell
 # Run mode 2 # Run mode 2
-$ sudo ./facenet -m ../data/facenet_int8.adla -p ../data/img/lin_2.jpg+$ sudo ./facenet -m ../data/model/facenet_int8.adla -p ../data/img/lin_2.jpg
 ``` ```
  
Last modified: 2023/09/17 23:03 by sravan