IDLive Face C API 1.47.0
|
Data Structures | |
struct | CMeta |
Meta information provided for calibration. More... | |
struct | CQualityResult |
Structure for quality estimation result. More... | |
struct | CLivenessResult |
Structure for liveness detection result. More... | |
struct | CPipelineResult |
Structure for liveness detection result. More... | |
struct | CBoundingBox |
Face rectangle bounding box. More... | |
struct | CBoundingBoxes |
Face rectangle bounding boxes array. More... | |
struct | CKeypoints |
Face keypoints structure. More... | |
struct | CHeadPose |
Set of yaw, pith, and roll angles (in degrees) More... | |
struct | CFaceParameters |
Structure for storing facial parameters. More... | |
struct | CDetectionResult |
Face detection result structure. More... | |
struct | CLicenseFeatureInfo |
IDLive Face license feature info. More... | |
Macros | |
#define | MESSAGE_BUFFER_SIZE 256 |
The default size for the buffer used for error messages (passed via msg argument). | |
Typedefs | |
typedef struct CInitConfig | CInitConfig_t |
typedef struct CImage | CImage_t |
typedef struct CImageBatch | CImageBatch_t |
typedef struct CPipeline | CPipeline_t |
typedef struct CDetectEngine | CDetectEngine_t |
typedef struct CQualityEngine | CQualityEngine_t |
typedef enum OS | OS_t |
Meta information: OS type for calibration. | |
typedef enum MANUFACTURE | MANUFACTURE_t |
Meta information: device manufacture. | |
typedef enum MODEL | MODEL_t |
Meta information: device model. | |
typedef enum CALIBRATION | CALIBRATION_t |
Liveness checking threshold calibration type. | |
typedef enum ThreadingLevel | ThreadingLevel_t |
FaceSDK threading level, used to set different number of threads for different levels. | |
typedef struct CMeta | CMeta_t |
typedef enum COLOR_ENCODING | COLOR_ENCODING_t |
Color encoding enum. | |
typedef struct CQualityResult | CQualityResult_t |
typedef struct CLivenessResult | CLivenessResult_t |
typedef struct CPipelineResult | CPipelineResult_t |
typedef struct CBoundingBox | CBoundingBox_t |
typedef struct CBoundingBoxes | CBoundingBoxes_t |
typedef struct CKeypoints | CKeypoints_t |
typedef struct CHeadPose | CHeadPose_t |
typedef struct CFaceParameters | CFaceParameters_t |
typedef struct CDetectionResult | CDetectionResult_t |
typedef enum LICENSE_FEATURE | LICENSE_FEATURE_t |
IDLive Face license features. | |
typedef struct CLicenseFeatureInfo | CLicenseFeatureInfo_t |
IDLive Face license feature info. | |
Functions | |
CMeta_t | get_default_meta () |
Returns CMeta_t filled with default values. | |
CInitConfig_t * | config_create (const char *folder, const char *config_name, int *err, char *msg) |
CInitConfig_t instance creator. | |
CInitConfig_t * | config_create2 (const char *file_path, int *err, char *msg) |
CInitConfig_t instance creator. | |
void | config_destroy (CInitConfig_t *config) |
CInitConfig_t instance destroyer. | |
CImage_t * | image_create_bytes (const uint8_t *bytes, size_t size, int *err, char *msg) |
Create CImage_t instance from binary file in memory buffer. | |
CImage_t * | image_create_path (const char *path, int *err, char *msg) |
Create CImage_t instance from a file on disk. | |
CImage_t * | image_create_pixels (const uint8_t *data, size_t rows, size_t cols, COLOR_ENCODING_t format, int *err, char *msg) |
Create CImage_t instance from decoded memory buffer. | |
void | image_destroy (CImage_t *image) |
CImage_t instance destroyer. | |
CImageBatch_t * | image_batch_create (CImage_t **images, size_t num_images, const uint64_t *timestamps, int *err, char *msg) |
Create CImageBatch_t instance from CImage_t array and timestamps. | |
void | image_batch_destroy (CImageBatch_t *image_batch) |
CImageBatch_t instance destroyer. | |
CDetectEngine_t * | detection_create (const char *name, const CInitConfig_t *config, int *err, char *msg) |
Create CDetectEngine_t instance. | |
void | detection_destroy (CDetectEngine_t *engine) |
CDetectEngine_t instance destroyer. | |
CDetectionResult_t * | detect (const CDetectEngine_t *engine, const CImage_t *image, int *err, char *msg) |
Facial keypoints and bbox detecting method. | |
CDetectionResult_t * | detect_batch (const CDetectEngine_t *engine, const CImage_t **images, size_t num_images, int *errors, char **msg) |
Facial keypoints and bbox batch detecting method. | |
CBoundingBoxes_t * | detect_only_bounding_box (const CDetectEngine_t *engine, const CImage_t *image, int *err, char *msg) |
Facial bbox detecting method. | |
CBoundingBoxes_t * | detect_only_bounding_box_batch (const CDetectEngine_t *engine, const CImage_t **images, size_t num_images, int *errors, char **msg) |
Facial bbox batch detecting method. | |
void | CDetectionResult_destroy (CDetectionResult_t *result) |
CDetectionResult_t instance destroyer. | |
void | CDetectionResult_destroy_array (CDetectionResult_t *result, size_t size) |
CDetectionResult_t instances array destroyer. | |
void | CBoundingBoxes_destroy (CBoundingBoxes_t *result) |
CBoundingBoxes_t instance destroyer. | |
void | CBoundingBoxes_destroy_array (CBoundingBoxes_t *result, size_t size) |
CBoundingBoxes_t instances array destroyer. | |
CQualityEngine_t * | quality_create (const char *name, const CInitConfig_t *config, int *err, char *msg) |
Create CQualityEngine_t instance. | |
void | quality_destroy (CQualityEngine_t *engine) |
CQualityEngine_t instance destroyer. | |
CQualityResult_t | check_quality (const CQualityEngine_t *engine, const CImage_t *image, int *err, char *msg) |
Check quality of face from input image. | |
CQualityResult_t * | check_quality_batch (const CQualityEngine_t *engine, const CImage_t **images, size_t num_images, int *errors, char **msg) |
Check quality of face from input images batch. | |
void | CQualityResult_destroy_array (CQualityResult_t *result) |
CQualityResult_t instances array destroyer. | |
CPipeline_t * | pipeline_create (const char *name, const CInitConfig_t *config, int *err, char *msg) |
Create CPipeline_t instance. | |
void | pipeline_destroy (CPipeline_t *engine) |
CPipeline_t instance destroyer. | |
CPipelineResult_t | pipeline_check_liveness (const CPipeline_t *engine, const CImage_t *image, const CMeta_t *meta, int *err, char *msg) |
Check liveness of face from input image. | |
CPipelineResult_t | pipeline_check_liveness_batch (const CPipeline_t *engine, const CImageBatch_t *image_batch, const CMeta_t *meta, int *err, char *msg) |
Perform liveness check on a sequence of photos (image batch). A single results corresponding to the whole image batch will be produced. | |
CPipelineResult_t * | pipeline_check_liveness_batch2 (const CPipeline_t *engine, const CImage_t **images, size_t num_images, const CMeta_t *meta, int *errors, char **msg) |
This method implements batched liveness check. | |
void | CPipelineResult_destroy_array (CPipelineResult_t *result) |
CPipelineResult_t instances array destroyer. | |
void | set_num_threads (unsigned int num_threads, const ThreadingLevel_t *threading_level, int *err, char *msg) |
Sets the maximum number of threads available for FaceSDK at the specified level. If 0 is passed, then the optimal number of threads is detected automatically (the same effect is achieved if setNumThreads is not called). | |
void | set_ov_num_throughput_streams (int ov_num_throughput_streams) |
Sets the number of CPU execution streams for OpenVINO backend. | |
void | set_ov_bind_threads (bool ov_bind_threads) |
Sets the CPU bind setting for OpenVINO backend. | |
void | set_ov_max_batch_size (unsigned int ov_max_batch_size) |
Sets the maximum batch size for OpenVINO backend. This is not a hard limit (i.e. passing batches bigger than the limit will not cause an error), however setting this value to the target batch size will increase performance. | |
void | set_enable_logging (bool enable_logging) |
Sets whether to enable FaceSDK logging. Logging is enabled by default. | |
void | set_num_pipeline_execution_streams (unsigned int num_pipeline_execution_streams) |
Sets the maximum number of execution streams (maximum number of requests executed in concurrent) for Pipeline. Default value is number of logical CPU cores. | |
void | set_enable_face_occlusion_detection (bool enabled) |
Toggles face occlusion detection. When enabled the occluded faces will be rejected. | |
void | set_enable_closed_eyes_detection (bool enabled) |
Toggles closed eyes detection. When enabled the faces with closed eyes will be rejected. | |
CLicenseFeatureInfo_t * | get_license_features_info (size_t *num_license_features, int *err, char *msg) |
Returns information about all available licensed features. | |
void | license_feature_info_array_destroy (CLicenseFeatureInfo_t *license_feature_info_arr) |
Destroys array of CLicenseFeatureInfo_t returned by @get_license_features_info. | |
void | get_license_info (char *license_info, size_t license_info_length, int *err, char *msg) |
Returns information about a license if available. | |
void | set_license (const char *license, size_t license_length, int *err, char *msg) |
Sets a new license to be used. | |
void | set_message_buffer_size (size_t size) |
Sets the size for the buffer used for error messages (passed via msg argument). Longer messages will be truncated. | |
FaceSDK C API header file
#define MESSAGE_BUFFER_SIZE 256 |
The default size for the buffer used for error messages (passed via msg
argument).
You can change it with set_message_buffer_size
if needed.
enum CALIBRATION |
enum COLOR_ENCODING |
enum LICENSE_FEATURE |
enum STATUS |
Error codes enumeration.
enum ThreadingLevel |
FaceSDK threading level, used to set different number of threads for different levels.
void CBoundingBoxes_destroy | ( | CBoundingBoxes_t * | result | ) |
CBoundingBoxes_t instance destroyer.
[in] | result | CBoundingBoxes_t instance |
void CBoundingBoxes_destroy_array | ( | CBoundingBoxes_t * | result, |
size_t | size | ||
) |
CBoundingBoxes_t instances array destroyer.
[in] | result | Pointer to CBoundingBoxes_t array |
[in] | size | Size of CBoundingBoxes_t array |
void CDetectionResult_destroy | ( | CDetectionResult_t * | result | ) |
CDetectionResult_t instance destroyer.
[in] | result | CDetectionResult_t instance |
void CDetectionResult_destroy_array | ( | CDetectionResult_t * | result, |
size_t | size | ||
) |
CDetectionResult_t instances array destroyer.
[in] | result | Pointer to CDetectionResult_t array |
[in] | size | Length of CDetectionResult_t array |
CQualityResult_t check_quality | ( | const CQualityEngine_t * | engine, |
const CImage_t * | image, | ||
int * | err, | ||
char * | msg | ||
) |
Check quality of face from input image.
[in] | engine | CQualityEngine_t instance |
[in] | image | CImage_t instance |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
CQualityResult_t * check_quality_batch | ( | const CQualityEngine_t * | engine, |
const CImage_t ** | images, | ||
size_t | num_images, | ||
int * | errors, | ||
char ** | msg | ||
) |
Check quality of face from input images batch.
[in] | engine | CQualityEngine_t instance |
[in] | images | Pointer to CImage_t* array |
[in] | num_images | Length of images array |
[out] | errors | Output error codes array optional parameter, should have num_images length if provided |
[out] | msg | Output error messages array optional parameter, should have num_images length if provided. |
num_images
length, NULL if error occurred check_quality
function. CInitConfig_t * config_create | ( | const char * | folder, |
const char * | config_name, | ||
int * | err, | ||
char * | msg | ||
) |
CInitConfig_t instance creator.
[in] | folder | Path to directory with configuration files |
[in] | config_name | Configuration file name |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
CInitConfig_t * config_create2 | ( | const char * | file_path, |
int * | err, | ||
char * | msg | ||
) |
CInitConfig_t instance creator.
[in] | file_path | Full path to configuration file |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
void config_destroy | ( | CInitConfig_t * | config | ) |
CInitConfig_t instance destroyer.
[in] | config | CInitConfig_t instance |
void CPipelineResult_destroy_array | ( | CPipelineResult_t * | result | ) |
CPipelineResult_t instances array destroyer.
[in] | result | Pointer to CPipelineResult_t array |
void CQualityResult_destroy_array | ( | CQualityResult_t * | result | ) |
CQualityResult_t instances array destroyer.
[in] | result | Pointer to CQualityResult_t array |
CDetectionResult_t * detect | ( | const CDetectEngine_t * | engine, |
const CImage_t * | image, | ||
int * | err, | ||
char * | msg | ||
) |
Facial keypoints and bbox detecting method.
[in] | engine | CDetectEngine_t instance |
[in] | image | CImage_t instance |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
CDetectionResult_t * detect_batch | ( | const CDetectEngine_t * | engine, |
const CImage_t ** | images, | ||
size_t | num_images, | ||
int * | errors, | ||
char ** | msg | ||
) |
Facial keypoints and bbox batch detecting method.
[in] | engine | CDetectEngine_t instance |
[in] | images | Pointer to CImage_t* array |
[in] | num_images | Length of images array |
[out] | errors | Output error codes array optional parameter, should have num_images length if provided |
[out] | msg | Output error messages array optional parameter, should have num_images length if provided. |
num_images
length, NULL if error occurred detect
function. CBoundingBoxes_t * detect_only_bounding_box | ( | const CDetectEngine_t * | engine, |
const CImage_t * | image, | ||
int * | err, | ||
char * | msg | ||
) |
Facial bbox detecting method.
[in] | engine | CDetectEngine_t instance |
[in] | image | CImage_t instance |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
CBoundingBoxes_t * detect_only_bounding_box_batch | ( | const CDetectEngine_t * | engine, |
const CImage_t ** | images, | ||
size_t | num_images, | ||
int * | errors, | ||
char ** | msg | ||
) |
Facial bbox batch detecting method.
[in] | engine | CDetectEngine_t instance |
[in] | images | Pointer to CImage_t* array |
[in] | num_images | Length of images array |
[out] | errors | Output error codes array optional parameter, should have num_images length if provided |
[out] | msg | Output error messages array optional parameter, should have num_images length if provided. |
num_images
length, NULL if error occurred detect_only_bounding_box
function. CDetectEngine_t * detection_create | ( | const char * | name, |
const CInitConfig_t * | config, | ||
int * | err, | ||
char * | msg | ||
) |
Create CDetectEngine_t instance.
[in] | name | Engine name (e.g. "BaseNnetDetector") |
[in] | config | Configuration object |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
void detection_destroy | ( | CDetectEngine_t * | engine | ) |
CDetectEngine_t instance destroyer.
[in] | engine | CDetectEngine_t instance |
CLicenseFeatureInfo_t * get_license_features_info | ( | size_t * | num_license_features, |
int * | err, | ||
char * | msg | ||
) |
Returns information about all available licensed features.
[out] | num_license_features | number of available licensed features. |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
void get_license_info | ( | char * | license_info, |
size_t | license_info_length, | ||
int * | err, | ||
char * | msg | ||
) |
Returns information about a license if available.
[out] | license_info | Preallocated char array to store null-terminated string containing license information |
[in] | license_info_length | Preallocated char array length |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
CImageBatch_t * image_batch_create | ( | CImage_t ** | images, |
size_t | num_images, | ||
const uint64_t * | timestamps, | ||
int * | err, | ||
char * | msg | ||
) |
Create CImageBatch_t instance from CImage_t array and timestamps.
[in] | images | Pointer to CImage_t* array |
[in] | num_images | Length of images array |
[in] | timestamps | Optional timestamps array, should have num_images length if provided |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
void image_batch_destroy | ( | CImageBatch_t * | image_batch | ) |
CImageBatch_t instance destroyer.
[in] | image_batch | CImageBatch_t instance |
CImage_t * image_create_bytes | ( | const uint8_t * | bytes, |
size_t | size, | ||
int * | err, | ||
char * | msg | ||
) |
Create CImage_t instance from binary file in memory buffer.
[in] | bytes | Pointer to memory buffer with binary image file |
[in] | size | Number of bytes in image file |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
CImage_t * image_create_path | ( | const char * | path, |
int * | err, | ||
char * | msg | ||
) |
Create CImage_t instance from a file on disk.
[in] | path | Path to image file |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
CImage_t * image_create_pixels | ( | const uint8_t * | data, |
size_t | rows, | ||
size_t | cols, | ||
COLOR_ENCODING_t | format, | ||
int * | err, | ||
char * | msg | ||
) |
Create CImage_t instance from decoded memory buffer.
[in] | data | Pointer to memory buffer (bytes) |
[in] | rows | Number of image rows |
[in] | cols | Number of image cols |
[in] | format | Color encoding format of input buffer |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
void image_destroy | ( | CImage_t * | image | ) |
CImage_t instance destroyer.
[in] | image | CImage_t instance |
void license_feature_info_array_destroy | ( | CLicenseFeatureInfo_t * | license_feature_info_arr | ) |
Destroys array of CLicenseFeatureInfo_t returned by @get_license_features_info.
[in] | license_feature_info_arr | Pointer to license feature info array |
CPipelineResult_t pipeline_check_liveness | ( | const CPipeline_t * | engine, |
const CImage_t * | image, | ||
const CMeta_t * | meta, | ||
int * | err, | ||
char * | msg | ||
) |
Check liveness of face from input image.
[in] | engine | CPipeline_t instance |
[in] | image | CImage_t instance |
[in] | meta | Optional meta information about device |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
CPipelineResult_t pipeline_check_liveness_batch | ( | const CPipeline_t * | engine, |
const CImageBatch_t * | image_batch, | ||
const CMeta_t * | meta, | ||
int * | err, | ||
char * | msg | ||
) |
Perform liveness check on a sequence of photos (image batch). A single results corresponding to the whole image batch will be produced.
[in] | engine | CPipeline_t instance |
[in] | image_batch | Input batch of images (a sequence of photos) |
[in] | meta | Optional meta information about device |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
CPipelineResult_t * pipeline_check_liveness_batch2 | ( | const CPipeline_t * | engine, |
const CImage_t ** | images, | ||
size_t | num_images, | ||
const CMeta_t * | meta, | ||
int * | errors, | ||
char ** | msg | ||
) |
This method implements batched liveness check.
[in] | engine | CPipeline_t instance |
[in] | images | Pointer to CImage_t* array |
[in] | num_images | Length of images array |
[in] | meta | Optional meta information about device array, should have num_images length if provided |
[out] | errors | Output error codes array optional parameter, should have num_images length if provided |
[out] | msg | Output error messages array optional parameter, should have num_images length if provided. |
num_images
length, NULL if error occurred pipeline_check_liveness
function. CPipeline_t * pipeline_create | ( | const char * | name, |
const CInitConfig_t * | config, | ||
int * | err, | ||
char * | msg | ||
) |
Create CPipeline_t instance.
[in] | name | Pipeline name (e.g. "ConfigurablePipeline") |
[in] | config | Configuration object |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
void pipeline_destroy | ( | CPipeline_t * | engine | ) |
CPipeline_t instance destroyer.
[in] | engine | CPipeline_t instance |
CQualityEngine_t * quality_create | ( | const char * | name, |
const CInitConfig_t * | config, | ||
int * | err, | ||
char * | msg | ||
) |
Create CQualityEngine_t instance.
[in] | name | Engine name (e.g. "ExpositionQualityEngine") |
[in] | config | Configuration object |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
void quality_destroy | ( | CQualityEngine_t * | engine | ) |
CQualityEngine_t instance destroyer.
[in] | engine | CQualityEngine_t instance |
void set_enable_closed_eyes_detection | ( | bool | enabled | ) |
Toggles closed eyes detection. When enabled the faces with closed eyes will be rejected.
[in] | enabled | Whether to enable the detection or not |
void set_enable_face_occlusion_detection | ( | bool | enabled | ) |
Toggles face occlusion detection. When enabled the occluded faces will be rejected.
[in] | enabled | Whether to enable the detection or not |
void set_enable_logging | ( | bool | enable_logging | ) |
Sets whether to enable FaceSDK logging. Logging is enabled by default.
[in] | enable_logging | Whether to enable logging or not |
void set_license | ( | const char * | license, |
size_t | license_length, | ||
int * | err, | ||
char * | msg | ||
) |
Sets a new license to be used.
Sets a new license to be used. On Mobile builds (Android and iOS) and Lambda SDK distributions this function can be used to update the license by passing the contents of a new license file.
[in] | license | char array with the license data |
[in] | license_length | length of the char array containing the license |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
void set_message_buffer_size | ( | size_t | size | ) |
Sets the size for the buffer used for error messages (passed via msg
argument). Longer messages will be truncated.
[in] | size | Size of the buffer. Passing 0 has no effect. |
void set_num_pipeline_execution_streams | ( | unsigned int | num_pipeline_execution_streams | ) |
Sets the maximum number of execution streams (maximum number of requests executed in concurrent) for Pipeline. Default value is number of logical CPU cores.
[in] | num_pipeline_execution_streams | Number of execution streams |
void set_num_threads | ( | unsigned int | num_threads, |
const ThreadingLevel_t * | threading_level, | ||
int * | err, | ||
char * | msg | ||
) |
Sets the maximum number of threads available for FaceSDK at the specified level. If 0 is passed, then the optimal number of threads is detected automatically (the same effect is achieved if setNumThreads is not called).
[in] | num_threads | Maximum number of threads available for FaceSDK at the specified level |
[in] | threading_level | Threading level to apply setting |
[out] | err | Output error code optional parameter |
[out] | msg | Output error message optional parameter. |
void set_ov_bind_threads | ( | bool | ov_bind_threads | ) |
Sets the CPU bind setting for OpenVINO backend.
[in] | ov_bind_threads | Whether to bind execution threads to CPU physical cores or not |
void set_ov_max_batch_size | ( | unsigned int | ov_max_batch_size | ) |
Sets the maximum batch size for OpenVINO backend. This is not a hard limit (i.e. passing batches bigger than the limit will not cause an error), however setting this value to the target batch size will increase performance.
[in] | ov_max_batch_size | Maximum batch size |
void set_ov_num_throughput_streams | ( | int | ov_num_throughput_streams | ) |
Sets the number of CPU execution streams for OpenVINO backend.
[in] | ov_num_throughput_streams | Number of CPU execution streams, valid values are -1 (auto-tune number of streams), 0 (use the default setting) and any positive value, other values are dropped without an error |