1 to 1 Face Recognition¶
-
ErrorCode Trueface::SDK::getFaceFeatureVector(const TFImage &tfImage, const FaceBoxAndLandmarks &faceBoxAndLandmarks, Faceprint &faceprint)¶
Extract the face feature vector from the face box.
- Parameters
tfImage – [in] the input image returned by preprocessImage().
faceBoxAndLandmarks – [in] the FaceBoxAndLandmarks returned by detectFaces() or detectLargestFace().
faceprint – [out] Faceprint to contain the face template.
- Returns
error code, see ErrorCode.
-
ErrorCode Trueface::SDK::getFaceFeatureVector(const TFFacechip &tfFacechip, Faceprint &faceprint)¶
Extract the face feature vector from an aligned face chip.
- Parameters
tfImage – [in] the input image returned by preprocessImage().
tfFacechip – [in] TFFacechip returned by extractAlignedFace(). Face image must be have size of 112x112 pixels (default extractAlignedFace() margin and scale values).
faceprint – [out] a Faceprint object which will contain the face feature vector.
- Returns
error code, see ErrorCode.
-
ErrorCode Trueface::SDK::getFaceFeatureVectors(const std::vector<TFFacechip> &tfFacechips, std::vector<Faceprint> &faceprints)¶
Extract the face feature vectors from the face chips. This batch processing method increases throughput when using GPU inference.
- Parameters
tfFacechips – [in] vector of TFFacechip.
faceprints – [out] vector of Faceprint object which will contain the face feature vectors.
- Returns
error code, see ErrorCode.
-
ErrorCode Trueface::SDK::getLargestFaceFeatureVector(const TFImage &tfImage, Faceprint &faceprint, bool &foundFace)¶
Detect the largest face in the image and return its feature vector.
- Parameters
tfImage – [in] the input image returned by preprocessImage().
faceprint – [out] a Faceprint object which will contain the face feature vector.
foundFace – [out] indicates if a face was detected in the image. If no face was detected, then the faceprint will be empty.
- Returns
error code, see ErrorCode.
-
static std::string Trueface::SDK::faceprintToJson(const Faceprint &faceprint)¶
Convert a Faceprint into a json string.
-
static ErrorCode Trueface::SDK::jsonToFaceprint(const std::string &jsonStr, Faceprint &faceprint)¶
Populate a Faceprint from a json string.
- Parameters
jsonStr – [in] The json string representation of a Faceprint, generated from the faceprintToJson() function.
faceprint – [out] The Faceprint which will be populated from the json string.
- Returns
error code, see ErrorCode.
-
static ErrorCode Trueface::SDK::getSimilarity(const Faceprint &faceprint1, const Faceprint &faceprint2, float &matchProbability, float &similarityMeasure)¶
Compute the similarity between two feature vectors, or how similar two faces are.
-
ErrorCode Trueface::SDK::estimateFaceImageQuality(const TFFacechip &tfFacechip, float &quality)¶
Estimate the quality of the face image for recognition.
- Parameters
tfFacechip – [in] The TFFacechip returned by extractAlignedFace().
quality – [out] a value between 0 to 1, 1 being prefect quality for recognition. We suggest using a threshold of 0.999 as a filter for enrollment images.
- Returns
error code, see ErrorCode.
-
struct Trueface::Faceprint¶
Face feature vector and meta data.
Public Members
-
std::vector<float> featureVector¶
Vector of floats which describe the face.
-
std::string modelName¶
Name of model used to generate feature vector.
-
ModelOptions modelOptions¶
Additional options used when generating the feature vector.
-
std::vector<float> featureVector¶
-
struct Trueface::ModelOptions¶
Options used when generating the feature vector.
Public Members
-
bool frVectorCompression = false¶
Indicates if the
Trueface::ConfigurationOptions.frVectorCompression
was enabled when generating the template.
-
bool frVectorCompression = false¶