Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim4:npu:demos:face-recognition

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:face-recognition [2023/10/30 02:24]
louis
products:sbc:vim4:npu:demos:face-recognition [2025/06/12 05:38] (current)
louis
Line 1: Line 1:
 ~~tag> NPU RetinaFace FaceNet VIM4 ~~ ~~tag> NPU RetinaFace FaceNet VIM4 ~~
 +
 +**Doc for version ddk-3.4.7.7**
  
 ====== Face Recognition VIM4 Demo - 7 ====== ====== Face Recognition VIM4 Demo - 7 ======
  
 {{indexmenu_n>7}} {{indexmenu_n>7}}
 +
 +Face Recognition Demo consists of two models, RetinaFace and FaceNet. It can detect face on image and recognize who it is. Here are two judgment indicators, cosine similarity and Euclidean distance. The closer the cosine similarity is to 1 and the closer the Euclidean distance is to 0, the more similar is between two faces.
 +
 +Here takes **lin_1.jpg** as example. Inference results on VIM4. Only show cosine similarity.
 +
 +{{:products:sbc:vim4:npu:demos:face-recognition-vim4-result-2.png?400|}} {{:products:sbc:vim4:npu:demos:face-recognition-vim4-result-1.jpg?400|}}
 +
 +**Inference speed test**: USB camera about **80ms** per frame.
  
 <WRAP important > <WRAP important >
Line 18: Line 28:
 $ git clone https://github.com/khadas/vim4_npu_applications $ git clone https://github.com/khadas/vim4_npu_applications
 ``` ```
 +
 +<WRAP important>
 +If your kernel is older than 241129, please use version before tag ddk-3.4.7.7.
 +</WRAP>
  
 ==== Install dependencies ==== ==== Install dependencies ====
Line 43: Line 57:
  
 # Run mode 1 # Run mode 1
-sudo ./face_recognition -M ../data/model/retinaface_int8.adla -m ../data/model/facenet_int8.adla -p 1+$ ./face_recognition -M ../data/model/retinaface_int8.adla -m ../data/model/facenet_int8.adla -p 1
 ``` ```
  
Line 50: Line 64:
 ```shell ```shell
 # Run mode 2 # Run mode 2
-sudo ./face_recognition -M ../data/model/retinaface_int8.adla -m ../data/model/facenet_int8.adla -p ../data/img/lin_2.jpg+$ ./face_recognition -M ../data/model/retinaface_int8.adla -m ../data/model/facenet_int8.adla -p ../data/img/lin_2.jpg
 ``` ```
  
Line 68: Line 82:
  
 # Run # Run
-sudo ./face_recognition_cap -M ../data/model/retinaface_int8.adla -m ../data/model/facenet_int8.adla -d 0+$ ./face_recognition_cap -M ../data/model/retinaface_int8.adla -m ../data/model/facenet_int8.adla -t usb -d 0
 ``` ```
  
 ''0'' is the camera device index. ''0'' is the camera device index.
Last modified: 2023/10/30 02:24 by louis