Face SDK  1.13.0 Mozart release
Face Recognition Software Development Kit
Classes | Macros | Typedefs | Functions | Variables
cpp interface

Classes

struct  face_sdk::matrix
 Matrix for affine transform, used by alignment_info class. More...
 
class  face_sdk::alignment_info
 Alignment info. Contains results of alignment. More...
 
class  face_sdk::data_container
 The data container object. The data container helps face_sdk to manage a data. More...
 
class  face_sdk::exception
 Base FaceSDK exception class. Almost all exceptions that FaceSDK throws are inherits this class. More...
 
class  face_sdk::face
 The face object. Face object contains information about face bounding box on the image and the original image. More...
 
class  face_sdk::fir
 The FIR object. FIR - Face Identification Record, biometric template. More...
 
class  face_sdk::image
 The image object. An image keeps bitmap data in 24bpp RBG format. More...
 
class  face_sdk::license
 The license object. A license object provides information about your limits in face_sdk. See Licensing. More...
 
class  face_sdk::license_callback
 Callback interface for remote license. More...
 
class  face_sdk::remote_license
 Remote license. Fetches license from server or from local cache. More...
 
class  face_sdk::pure_fir_extractor
 Module allows to extract pure data from FIRs. Pure data can be used to implement manual matching, encryption, serialization, etc... Use face_sdk::make_pure_fir_extractor() functions to instantiate pure_fir_extractor object. More...
 
class  face_sdk::serializer
 The serializer object. The serializer object allows serialize and deserialize face_sdk::face, face_sdk::alignment_info, face_sdk::fir objects. More...
 
class  face_sdk::version_info
 The version_info class provides information about FaceSDK version. See Available algorightm versions and versions compatibility. More...
 
class  face_sdk::video_frame
 A video frame contains image and meta-information about this image in video stream context. More...
 
class  face_sdk::video_stream
 A video stream represents a sequence of frames. More...
 

Macros

#define UPSCALE_TOO_MUCH_EXCEPTION_CODE   2000
 

Typedefs

typedef std::vector< std::shared_ptr< face_sdk::alignment_info > > face_sdk::alignment_info_set
 
typedef std::vector< std::shared_ptr< face_sdk::face > > face_sdk::face_set
 
typedef std::vector< std::shared_ptr< face_sdk::fir > > face_sdk::fir_set
 
typedef std::vector< std::shared_ptr< image > > face_sdk::image_set
 

Functions

std::shared_ptr< face_sdk::data_containerface_sdk::load_data_container_from_file (const std::string &file_name)
 Load a data container from file. More...
 
std::shared_ptr< face_sdk::data_containerface_sdk::load_data_container (const std::vector< uint8_t > &raw_data)
 Load a data container from memory. More...
 
bool face_sdk::is_root_exception_of_type (const std::type_info &tp, const face_sdk::exception &e)
 
std::shared_ptr< face_sdk::faceface_sdk::make_face (const std::shared_ptr< image > &img)
 Makes the face object. Bounding box size is set equal to the original image size. More...
 
std::shared_ptr< face_sdk::faceface_sdk::make_face (const std::shared_ptr< image > &img, uint32_t version)
 Makes the face object with specified version. Bounding box size is set equal to the original image size. More...
 
std::shared_ptr< face_sdk::faceface_sdk::make_face (const std::shared_ptr< image > &img, bool out_of_bounds, uint32_t version)
 Makes the face object with specified out of bound flag and version. Bounding box size is set equal to the original image size. More...
 
std::shared_ptr< face_sdk::faceface_sdk::make_face (const std::shared_ptr< image > &img, int32_t x, int32_t y, int32_t width, int32_t height, float confidence)
 Makes the face object with specified coordinates of bounding box and confidence. More...
 
std::shared_ptr< face_sdk::faceface_sdk::make_face (const std::shared_ptr< image > &img, int32_t x, int32_t y, int32_t width, int32_t height, float confidence, uint32_t version)
 Makes the face object with specified coordinates of bounding box, confidence and version. More...
 
std::shared_ptr< face_sdk::faceface_sdk::make_face (const std::shared_ptr< image > &img, int32_t x, int32_t y, int32_t width, int32_t height, float confidence, bool out_of_bounds, uint32_t version)
 Makes the face object with specified coordinates of bounding box, confidence, out_of_bounds flag and version. More...
 
std::shared_ptr< face_sdk::faceface_sdk::make_face (const std::shared_ptr< image > &img, int32_t x, int32_t y, int32_t width, int32_t height, float confidence, const std::vector< std::tuple< int32_t, int32_t > > &landmarks)
 Makes the face object with specified coordinates of bounding box, confidence and landmarks. More...
 
std::shared_ptr< face_sdk::faceface_sdk::make_face (const std::shared_ptr< image > &img, int32_t x, int32_t y, int32_t width, int32_t height, float confidence, const std::vector< std::tuple< int32_t, int32_t > > &landmarks, uint32_t version)
 Makes the face object with specified coordinates of bounding box, confidence, landmarks and version. More...
 
std::shared_ptr< face_sdk::faceface_sdk::make_face (const std::shared_ptr< image > &img, int32_t x, int32_t y, int32_t width, int32_t height, float confidence, const std::vector< std::tuple< int32_t, int32_t > > &landmarks, bool out_of_bounds, uint32_t version)
 Makes the face object with specified coordinates of bounding box, confidence, landmarks, out_of_bounds flag and version. More...
 
std::shared_ptr< face_sdk::faceface_sdk::make_face (const std::shared_ptr< image > &img, int32_t x, int32_t y, int32_t width, int32_t height, float confidence, const std::vector< std::tuple< int32_t, int32_t > > &landmarks, const std::shared_ptr< image > &cropped_image)
 Makes the face object with specified coordinates of bounding box, confidence, landmarks and cropped image. More...
 
std::shared_ptr< face_sdk::faceface_sdk::make_face (const std::shared_ptr< image > &img, int32_t x, int32_t y, int32_t width, int32_t height, float confidence, const std::vector< std::tuple< int32_t, int32_t > > &landmarks, const std::shared_ptr< image > &cropped_image, uint32_t version)
 Makes the face object with specified coordinates of bounding box, confidence, landmarks, cropped_image version. More...
 
std::shared_ptr< face_sdk::faceface_sdk::make_face (const std::shared_ptr< image > &img, int32_t x, int32_t y, int32_t width, int32_t height, float confidence, const std::vector< std::tuple< int32_t, int32_t > > &landmarks, const std::shared_ptr< image > &cropped_image, bool out_of_bounds, uint32_t version)
 Makes the face object with specified coordinates of bounding box, landmarks, cropped_image, out_of_bounds flag and version. More...
 
std::shared_ptr< firface_sdk::convert_to_short_fir (const std::shared_ptr< face_sdk::fir > &long_fir)
 Converts fir with long data type to short.
 
std::shared_ptr< face_sdk::imageface_sdk::load_image_from_file (const std::string &file_name)
 Load encoded image from file. Image must be in RBG or BRG channels order. Grayscale or images with alfa-channel not allowed.
More...
 
std::shared_ptr< face_sdk::imageface_sdk::load_image_from_data (const std::uint8_t *data, int32_t data_size)
 Load encoded image from memory. More...
 
std::shared_ptr< face_sdk::imageface_sdk::make_image_from_data (const std::uint8_t *data, std::uint32_t width, std::uint32_t height)
 Makes image object from bitmap. Bitmap must 24bpp RGB format. More...
 
std::shared_ptr< face_sdk::imageface_sdk::make_image_from_data (const std::uint8_t *data, std::uint32_t width, std::uint32_t height, std::uint32_t stride)
 Makes image object from bitmap. Bitmap must 24bpp RGB format. More...
 
std::shared_ptr< face_sdk::licenseface_sdk::load_licence_from_file ()
 Load license from file in known paths. (see Known paths) More...
 
std::shared_ptr< face_sdk::licenseface_sdk::load_licence_from_file (const std::string &license_file)
 Load license from specified file. More...
 
std::shared_ptr< face_sdk::licenseface_sdk::load_licence_from_data (const std::vector< uint8_t > &data)
 Load license from memory. More...
 
std::vector< uint8_t > face_sdk::generate_license_request (std::vector< uint32_t > gpu_ids=std::vector< uint32_t >())
 Api function to generate license request. Usually you can use face_sdk_utils for this purpose. More...
 
std::shared_ptr< face_sdk::remote_licenseface_sdk::make_remote_license (const std::string &token)
 Makes remote license with specified token. More...
 
std::shared_ptr< face_sdk::remote_licenseface_sdk::make_remote_license (const std::string &token, const std::string &filename)
 Makes remote license with specified token and filename. More...
 
std::shared_ptr< face_sdk::remote_licenseface_sdk::make_remote_license (const std::string &token, const std::shared_ptr< face_sdk::license_callback > &callback)
 Makes remote license with specified token and callback. More...
 
std::shared_ptr< face_sdk::remote_licenseface_sdk::make_remote_license (const std::string &token, const std::vector< uint8_t > &request, const std::shared_ptr< face_sdk::license_callback > &callback)
 Makes remote license with specified token, request and callback. More...
 
std::shared_ptr< face_sdk::licenseface_sdk::make_default_license ()
 Make license depending on environment variables (FACE_SDK_REMOTE_LICENSE_DEFAULT and FACE_SDK_REMOTE_LICENSE_TOKEN). set FACE_SDK_REMOTE_LICENSE_DEFAULT to '1' to construct remote_license by default, then FACE_SDK_REMOTE_LICENSE_TOKEN must contain license token. More...
 
std::shared_ptr< pure_fir_extractorface_sdk::make_pure_fir_extractor ()
 Makes face_sdk::pure_fir_extractor with default license.
 
std::shared_ptr< pure_fir_extractorface_sdk::make_pure_fir_extractor (const std::shared_ptr< face_sdk::license > &license)
 Makes face_sdk::pure_fir_extractor with specified license.
 
std::shared_ptr< face_sdk::serializerface_sdk::make_serializer ()
 Makes the face_sdk::serializer object.
 
std::shared_ptr< version_infoface_sdk::make_version_info ()
 Makes an instance of face_sdk::version_info.
 
std::shared_ptr< video_frameface_sdk::make_video_frame (uint64_t frame_id, std::chrono::milliseconds timestamp, const std::shared_ptr< face_sdk::image > &image)
 Makes a video frame with specified frame_id, timestamp and image. More...
 

Variables

const float face_sdk::UNKNOWN_CONFIDENCE = .0f
 
const uint32_t face_sdk::UNKNOWN_VERSION = 0
 

Detailed Description

Function Documentation

◆ generate_license_request()

std::vector<uint8_t> face_sdk::generate_license_request ( std::vector< uint32_t >  gpu_ids = std::vector< uint32_t >())

Api function to generate license request. Usually you can use face_sdk_utils for this purpose.

Parameters
[in]gpu_idsValue of this parameter should be the number of GPU-device, where the algorithms are to be executed.
Exceptions
face_sdk::invalid_parameter_exceptionIf there is no gpu device with such id.
Examples:
license.cpp.

◆ load_data_container()

std::shared_ptr<face_sdk::data_container> face_sdk::load_data_container ( const std::vector< uint8_t > &  raw_data)

Load a data container from memory.

Parameters
[in]raw_datadata with saved data_container
Exceptions
face_sdk::exception

◆ load_data_container_from_file()

std::shared_ptr<face_sdk::data_container> face_sdk::load_data_container_from_file ( const std::string &  file_name)

Load a data container from file.

Parameters
[in]file_namefile name with saved data_container
Exceptions
face_sdk::exception

◆ load_image_from_data()

std::shared_ptr<face_sdk::image> face_sdk::load_image_from_data ( const std::uint8_t *  data,
int32_t  data_size 
)

Load encoded image from memory.

Parameters
[in]datapointer to memory with encoded image
[in]data_sizesize of data
Exceptions
face_sdk::exception

◆ load_image_from_file()

std::shared_ptr<face_sdk::image> face_sdk::load_image_from_file ( const std::string &  file_name)

Load encoded image from file. Image must be in RBG or BRG channels order. Grayscale or images with alfa-channel not allowed.

Exceptions
face_sdk::exception
Examples:
complex.cpp, serialize.cpp, and tracker.cpp.

◆ load_licence_from_data()

std::shared_ptr<face_sdk::license> face_sdk::load_licence_from_data ( const std::vector< uint8_t > &  data)

Load license from memory.

Parameters
[in]datadata with license
Exceptions
face_sdk::exception

◆ load_licence_from_file() [1/2]

std::shared_ptr<face_sdk::license> face_sdk::load_licence_from_file ( )

Load license from file in known paths. (see Known paths)

Exceptions
face_sdk::exception

◆ load_licence_from_file() [2/2]

std::shared_ptr<face_sdk::license> face_sdk::load_licence_from_file ( const std::string &  license_file)

Load license from specified file.

Parameters
[in]license_filefile with license
Exceptions
face_sdk::file_exceptionif can't read file
face_sdk::exception

◆ make_default_license()

std::shared_ptr<face_sdk::license> face_sdk::make_default_license ( )

Make license depending on environment variables (FACE_SDK_REMOTE_LICENSE_DEFAULT and FACE_SDK_REMOTE_LICENSE_TOKEN). set FACE_SDK_REMOTE_LICENSE_DEFAULT to '1' to construct remote_license by default, then FACE_SDK_REMOTE_LICENSE_TOKEN must contain license token.

Exceptions
face_sdk::exception

◆ make_face() [1/12]

std::shared_ptr<face_sdk::face> face_sdk::make_face ( const std::shared_ptr< image > &  img)

Makes the face object. Bounding box size is set equal to the original image size.

Parameters
[in]imgImage with face
Exceptions
face_sdk::exception
Examples:
serialize.cpp.

◆ make_face() [2/12]

std::shared_ptr<face_sdk::face> face_sdk::make_face ( const std::shared_ptr< image > &  img,
uint32_t  version 
)

Makes the face object with specified version. Bounding box size is set equal to the original image size.

Parameters
[in]imgImage with face
[in]versionFace object version
Exceptions
face_sdk::exceptionSee Exceptions handling

◆ make_face() [3/12]

std::shared_ptr<face_sdk::face> face_sdk::make_face ( const std::shared_ptr< image > &  img,
bool  out_of_bounds,
uint32_t  version 
)

Makes the face object with specified out of bound flag and version. Bounding box size is set equal to the original image size.

Parameters
[in]imgImage with face
[in]out_of_boundsFace out of bounds flag
[in]versionFace object version
Exceptions
face_sdk::exceptionSee Exceptions handling

◆ make_face() [4/12]

std::shared_ptr<face_sdk::face> face_sdk::make_face ( const std::shared_ptr< image > &  img,
int32_t  x,
int32_t  y,
int32_t  width,
int32_t  height,
float  confidence 
)

Makes the face object with specified coordinates of bounding box and confidence.

Parameters
[in]imgImage with face
[in]xX coordinate of face bounding box in pixels
[in]yY coordinate of face bounding box in pixels
[in]widthWidth of face bounding box in pixels
[in]heightHeight of face bounding box in pixels
[in]confidencealways set to 1.0f
Exceptions
face_sdk::exceptionSee Exceptions handling

◆ make_face() [5/12]

std::shared_ptr<face_sdk::face> face_sdk::make_face ( const std::shared_ptr< image > &  img,
int32_t  x,
int32_t  y,
int32_t  width,
int32_t  height,
float  confidence,
uint32_t  version 
)

Makes the face object with specified coordinates of bounding box, confidence and version.

Parameters
[in]imgImage with face
[in]xX coordinate of face bounding box in pixels
[in]yY coordinate of face bounding box in pixels
[in]widthWidth of face bounding box in pixels
[in]heightHeight of face bounding box in pixels
[in]confidencealways set to 1.0f
[in]versionFace object version
Exceptions
face_sdk::exceptionSee Exceptions handling

◆ make_face() [6/12]

std::shared_ptr<face_sdk::face> face_sdk::make_face ( const std::shared_ptr< image > &  img,
int32_t  x,
int32_t  y,
int32_t  width,
int32_t  height,
float  confidence,
bool  out_of_bounds,
uint32_t  version 
)

Makes the face object with specified coordinates of bounding box, confidence, out_of_bounds flag and version.

Parameters
[in]imgImage with face
[in]xX coordinate of face bounding box in pixels
[in]yY coordinate of face bounding box in pixels
[in]widthWidth of face bounding box in pixels
[in]heightHeight of face bounding box in pixels
[in]confidencealways set to 1.0f
[in]out_of_boundsFace out of bounds flag
[in]versionFace object version
Exceptions
face_sdk::exceptionSee Exceptions handling

◆ make_face() [7/12]

std::shared_ptr<face_sdk::face> face_sdk::make_face ( const std::shared_ptr< image > &  img,
int32_t  x,
int32_t  y,
int32_t  width,
int32_t  height,
float  confidence,
const std::vector< std::tuple< int32_t, int32_t > > &  landmarks 
)

Makes the face object with specified coordinates of bounding box, confidence and landmarks.

Parameters
[in]imgImage with face
[in]xX coordinate of face bounding box in pixels
[in]yY coordinate of face bounding box in pixels
[in]widthWidth of face bounding box in pixels
[in]heightHeight of face bounding box in pixels
[in]confidencealways set to 1.0f
[in]landmarksFace landmarks
Exceptions
face_sdk::exceptionSee Exceptions handling

◆ make_face() [8/12]

std::shared_ptr<face_sdk::face> face_sdk::make_face ( const std::shared_ptr< image > &  img,
int32_t  x,
int32_t  y,
int32_t  width,
int32_t  height,
float  confidence,
const std::vector< std::tuple< int32_t, int32_t > > &  landmarks,
uint32_t  version 
)

Makes the face object with specified coordinates of bounding box, confidence, landmarks and version.

Parameters
[in]imgImage with face
[in]xX coordinate of face bounding box in pixels
[in]yY coordinate of face bounding box in pixels
[in]widthWidth of face bounding box in pixels
[in]heightHeight of face bounding box in pixels
[in]confidencealways set to 1.0f
[in]landmarksFace landmarks
[in]versionFace object version
Exceptions
face_sdk::exceptionSee Exceptions handling

◆ make_face() [9/12]

std::shared_ptr<face_sdk::face> face_sdk::make_face ( const std::shared_ptr< image > &  img,
int32_t  x,
int32_t  y,
int32_t  width,
int32_t  height,
float  confidence,
const std::vector< std::tuple< int32_t, int32_t > > &  landmarks,
bool  out_of_bounds,
uint32_t  version 
)

Makes the face object with specified coordinates of bounding box, confidence, landmarks, out_of_bounds flag and version.

Parameters
[in]imgImage with face
[in]xX coordinate of face bounding box in pixels
[in]yY coordinate of face bounding box in pixels
[in]widthWidth of face bounding box in pixels
[in]heightHeight of face bounding box in pixels
[in]confidencealways set to 1.0f
[in]landmarksFace landmarks
[in]out_of_boundsFace out of bounds flag
[in]versionFace object version
Exceptions
face_sdk::exceptionSee Exceptions handling

◆ make_face() [10/12]

std::shared_ptr<face_sdk::face> face_sdk::make_face ( const std::shared_ptr< image > &  img,
int32_t  x,
int32_t  y,
int32_t  width,
int32_t  height,
float  confidence,
const std::vector< std::tuple< int32_t, int32_t > > &  landmarks,
const std::shared_ptr< image > &  cropped_image 
)

Makes the face object with specified coordinates of bounding box, confidence, landmarks and cropped image.

Parameters
[in]imgImage with face
[in]xX coordinate of face bounding box in pixels
[in]yY coordinate of face bounding box in pixels
[in]widthWidth of face bounding box in pixels
[in]heightHeight of face bounding box in pixels
[in]confidencealways set to 1.0f
[in]landmarksFace landmarks
[in]cropped_imageCropped face
Exceptions
face_sdk::exceptionSee Exceptions handling

◆ make_face() [11/12]

std::shared_ptr<face_sdk::face> face_sdk::make_face ( const std::shared_ptr< image > &  img,
int32_t  x,
int32_t  y,
int32_t  width,
int32_t  height,
float  confidence,
const std::vector< std::tuple< int32_t, int32_t > > &  landmarks,
const std::shared_ptr< image > &  cropped_image,
uint32_t  version 
)

Makes the face object with specified coordinates of bounding box, confidence, landmarks, cropped_image version.

Parameters
[in]imgImage with face
[in]xX coordinate of face bounding box in pixels
[in]yY coordinate of face bounding box in pixels
[in]widthWidth of face bounding box in pixels
[in]heightHeight of face bounding box in pixels
[in]confidencealways set to 1.0f
[in]landmarksFace landmarks
[in]cropped_imageCropped face
[in]versionFace object version
Exceptions
face_sdk::exceptionSee Exceptions handling

◆ make_face() [12/12]

std::shared_ptr<face_sdk::face> face_sdk::make_face ( const std::shared_ptr< image > &  img,
int32_t  x,
int32_t  y,
int32_t  width,
int32_t  height,
float  confidence,
const std::vector< std::tuple< int32_t, int32_t > > &  landmarks,
const std::shared_ptr< image > &  cropped_image,
bool  out_of_bounds,
uint32_t  version 
)

Makes the face object with specified coordinates of bounding box, landmarks, cropped_image, out_of_bounds flag and version.

Parameters
[in]imgImage with face
[in]xX coordinate of face bounding box in pixels
[in]yY coordinate of face bounding box in pixels
[in]widthWidth of face bounding box in pixels
[in]heightHeight of face bounding box in pixels
[in]landmarksFace landmarks
[in]cropped_imageCropped face
[in]out_of_boundsFace out of bounds flag
[in]versionFace object version
Exceptions
face_sdk::exceptionSee Exceptions handling

◆ make_image_from_data() [1/2]

std::shared_ptr<face_sdk::image> face_sdk::make_image_from_data ( const std::uint8_t *  data,
std::uint32_t  width,
std::uint32_t  height 
)

Makes image object from bitmap. Bitmap must 24bpp RGB format.

Parameters
[in]datapointer to memory with bitmap
[in]widthbitmap width in pixels
[in]heightbitmap height in pixels

◆ make_image_from_data() [2/2]

std::shared_ptr<face_sdk::image> face_sdk::make_image_from_data ( const std::uint8_t *  data,
std::uint32_t  width,
std::uint32_t  height,
std::uint32_t  stride 
)

Makes image object from bitmap. Bitmap must 24bpp RGB format.

Parameters
[in]datapointer to memory with bitmap
[in]widthbitmap width in pixels
[in]heightbitmap height in pixels
[in]stridebitmap row size in bytes

◆ make_remote_license() [1/4]

std::shared_ptr<face_sdk::remote_license> face_sdk::make_remote_license ( const std::string &  token)

Makes remote license with specified token.

Parameters
[in]tokenToken
Exceptions
face_sdk::exception

◆ make_remote_license() [2/4]

std::shared_ptr<face_sdk::remote_license> face_sdk::make_remote_license ( const std::string &  token,
const std::string &  filename 
)

Makes remote license with specified token and filename.

Parameters
[in]tokenToken
[in]filenameLocal file to store fetched license
Exceptions
face_sdk::exception

◆ make_remote_license() [3/4]

std::shared_ptr<face_sdk::remote_license> face_sdk::make_remote_license ( const std::string &  token,
const std::shared_ptr< face_sdk::license_callback > &  callback 
)

Makes remote license with specified token and callback.

Parameters
[in]tokenToken
[in]callbackCallback object that will be notified on license updates
Exceptions
face_sdk::exception

◆ make_remote_license() [4/4]

std::shared_ptr<face_sdk::remote_license> face_sdk::make_remote_license ( const std::string &  token,
const std::vector< uint8_t > &  request,
const std::shared_ptr< face_sdk::license_callback > &  callback 
)

Makes remote license with specified token, request and callback.

Parameters
[in]tokenToken
[in]requestLicense request data
[in]callbackCallback object that will be notified on license updates
Exceptions
face_sdk::exception

◆ make_video_frame()

std::shared_ptr<video_frame> face_sdk::make_video_frame ( uint64_t  frame_id,
std::chrono::milliseconds  timestamp,
const std::shared_ptr< face_sdk::image > &  image 
)

Makes a video frame with specified frame_id, timestamp and image.

Examples:
tracker.cpp.