espressif / esp-dl

Espressif deep-learning library for AIoT applications
MIT License
548 stars 118 forks source link

About face detection and face recognition #30

Closed Rita858 closed 3 years ago

Rita858 commented 4 years ago

Hi, I just wonder:

  1. Where is the "face id vectors" exactly store in CameraWebServer? (flash or RAM?)
  2. And how many face id can it store?
  3. Does face recognition use a one-to-one comparison to get the owner of the face or a one-to-many(face id) method to find the person?
  4. What is the value of FR and FA?
  5. How long does it take on face detection? What about face recognition?

I am new about this. Hope to get your help soon. Thank you.

TiramisuJ commented 4 years ago

Hi

  1. In CameraWebServer, The face id vectors are stored in RAM.
  2. You can set the maximum number of face IDs that can be stored, in the CameraWebServer, you can set the 'FACE_ID_SAVE_NUMBER' in 'app_httpd.cpp'.
  3. The face recognition will compare the face information that has been enrolled so far.
  4. Sorry i didn't understand this question. FD and FR mean face detection and face recognition respectively.
  5. You can refer to face_detection and face_recognition for more details.
Rita858 commented 4 years ago

Hi

  1. In CameraWebServer, The face id vectors are stored in RAM.
  2. You can set the maximum number of face IDs that can be stored, in the CameraWebServer, you can set the 'FACE_ID_SAVE_NUMBER' in 'app_httpd.cpp'.
  3. The face recognition will compare the face information that has been enrolled so far.
  4. Sorry i didn't understand this question. FD and FR mean face detection and face recognition respectively.
  5. You can refer to face_detection and face_recognition for more details.

Great, thank you. By the way, FR means false acceptance rate and FA means false rejection rate. Can you tell me their values and what function of "EYE_DIST_SET" is?

TiramisuJ commented 4 years ago
  1. FAR and FRR are not independent of each other, and the relationship between them can be represented by the ROC curve. For different test sets, the ROC curve of our model is also different. The FRR corresponding to a fixed FAR under a specific test set may be a more reasonable performance indicator.
  2. ‘EYE_DIST_SET' is a parameter that we used for face alignment before, and it is used to indicate the distance between the two eyes of the aligned face. But we have adopted a new face alignment method, and no longer use the ‘EYE_DIST_SET’ parameter.
Rita858 commented 4 years ago
  1. FAR and FRR are not independent of each other, and the relationship between them can be represented by the ROC curve. For different test sets, the ROC curve of our model is also different. The FRR corresponding to a fixed FAR under a specific test set may be a more reasonable performance indicator.
  2. ‘EYE_DIST_SET' is a parameter that we used for face alignment before, and it is used to indicate the distance between the two eyes of the aligned face. But we have adopted a new face alignment method, and no longer use the ‘EYE_DIST_SET’ parameter.

Then, could you tell me that does “FACE_ID_SIZE” means the size of "The face id vectors"? Or what is the fixed max size of "The face id vectors"?

TiramisuJ commented 4 years ago
  1. FAR and FRR are not independent of each other, and the relationship between them can be represented by the ROC curve. For different test sets, the ROC curve of our model is also different. The FRR corresponding to a fixed FAR under a specific test set may be a more reasonable performance indicator.
  2. ‘EYE_DIST_SET' is a parameter that we used for face alignment before, and it is used to indicate the distance between the two eyes of the aligned face. But we have adopted a new face alignment method, and no longer use the ‘EYE_DIST_SET’ parameter.

Then, could you tell me that does “FACE_ID_SIZE” means the size of "The face id vectors"? Or what is the fixed max size of "The face id vectors"?

‘FACE_ID_SIZE’ is the length of each face vector. This value depends on the face recognition model. At present, the length of the face vector obtained by our model is 512.

Rita858 commented 4 years ago

I found that it just can detect one face at a time in CameraWebServer. I wonder if I can detect multi-face through this lib? How many (max) faces can it detect in a frame simultaneously?

TiramisuJ commented 4 years ago

I found that it just can detect one face at a time in CameraWebServer. I wonder if I can detect multi-face through this lib? How many (max) faces can it detect in a frame simultaneously?

Well, if you want to detect multiple faces in one frame, you can set the 'mtmn_config.o_threshold.candidate_number' in the 'app_httpd.cpp' to a larger number, such as 100.

Rita858 commented 4 years ago

Hi, it's been a long time. I'm here to bother you again.

When I test the size of the new face ID, there is a strange result below: image I remember that you said that the size is 512.

This is my code below:

Serial.printf("Enrolled Face ID: %d\n", id_list.tail);
Serial.printf("Enrolled Face ID Size: %d\n", sizeof(id_list.id_list[id_list.tail]));
Serial.printf("Enrolled Face ID list Size: %d\n", sizeof(id_list));

Did I do it wrong? And how can I get it?

Hope to receive your answer soon. Thank you!

TiramisuJ commented 4 years ago
  1. ‘id_list.id_list[id_list.tail])’ is a pointer to a 'dl_matrix3d_t' structure,so the size of the pointer is 4, and the face vector with a length of 512 is stored in the 'dl_matrix3d_t' structure.
  2. 'id_list' is a 'face_id_list' structure, the size of the 'dl_matrix3d_t **' is 4, So this structure is 4 bytes aligned, and the size of 'face_id_list' structure is 12.
Rita858 commented 4 years ago
  1. ‘id_list.id_list[id_list.tail])’ is a pointer to a 'dl_matrix3d_t' structure,so the size of the pointer is 4, and the face vector with a length of 512 is stored in the 'dl_matrix3d_t' structure.
  2. 'id_list' is a 'face_id_list' structure, the size of the 'dl_matrix3d_t **' is 4, So this structure is 4 bytes aligned, and the size of 'face_id_list' structure is 12.

So nice you are.Thank you. Finally, I got that size.