KanduAI SDK API
KanduAI SDK API

Face Recognition

Face Recognition description

Functions

void *rf_face_recognition_init(const char *landmarks_path, const char *recognition_path, rf_error_type *error)

Initializes face recognition.

Return

face recognition handle

Parameters
  • landmarks_path: path to the landmarks model

  • recognition_path: path to the recognition model

  • error: output parameter to return an error details

void rf_face_recognition_close(void *face_recognition_handle, rf_error_type *error)

Deletes face recognition.

Parameters
  • face_recognition_handle: face recognition handle

  • error: output parameter to return an error details

void rf_face_recognition_get_embedding(void *face_recognition_handle, void *image_handle, int ymin, int xmin, int ymax, int xmax, rf_float_vector_type *out_embedding, rf_error_type *error)

Extracts face embedding vector from cropped face.

Parameters
  • face_recognition_handle: face recognition handle

  • image_handle: full image handle (use image API to create)

  • ymin: the top y position of the bounding box where the face is located

  • xmin: the left x position of the bounding box where the face is located

  • ymax: the bottom y position of the bounding box where the face is located

  • xmax: the right x position of the bounding box where the face is located

  • out_embedding: output parameter to return a 128-dimension embedding vector

  • error: output parameter to return an error details

void rf_face_recognition_get_embedding_from_aligned_face(void *face_recognition_handle, void *aligned_face_handle, rf_float_vector_type *out_embedding, rf_error_type *error)

Extracts face embedding vector from cropped face.

Parameters
  • face_recognition_handle: face recognition handle

  • aligned_face_handle: aligned image handle (use rf_face_landmarks_align_face to create)

  • out_embedding: output parameter to return a 128-dimension embedding vector

  • error: output parameter to return an error details