1N Identification¶
-
ErrorCode
Trueface::SDK
::
createDatabaseConnection
(const std::string &databaseConnectionString)¶ Create a connection to a new or existing database. If the database does not exist, a new one will be created with the provided name. If the NONE DatabaseManagementSystem (memory only) configuration option is selected, this function does not need to be called (and is a harmless no-op).
- Return
error code, see ErrorCode.
- Parameters
databaseConnectionString
: If SQLITE DatabaseManagementSystem is selected, this should be the filepath to the database. ex. “/myPath/myDatabase.db”
-
ErrorCode
Trueface::SDK
::
createLoadCollection
(const std::string &collectionName)¶ Create a new collection, or load data from an existing collection if one with the provided name already exists in the database.
- Return
error code, see ErrorCode.
- Parameters
[in] collectionName
: the name of the collection.
-
ErrorCode
Trueface::SDK
::
enrollTemplate
(const Faceprint &faceprint, const std::string &identity, std::string &UUID)¶ Enroll a template for a new or existing identity in the collection.
- Return
error code, see ErrorCode.
- Parameters
[in] faceprint
: the template to enroll in the collection.[in] identity
: the identity corresponding to the template.[out] UUID
: universally unique identifier corresponding to the template.
-
ErrorCode
Trueface::SDK
::
removeByUUID
(const std::string &UUID)¶ Remove a template from the collection using the UUID.
- Return
error code, see ErrorCode.
- Parameters
[in] UUID
: the universally unique identifier corresponding to the template to be removed from the collection.
-
ErrorCode
Trueface::SDK
::
removeByIdentity
(const std::string &identity)¶ Remove all templates in the collection corresponding to the identity.
- Return
error code, see ErrorCode.
- Parameters
[in] identity
: the identity to remove from the collection.
-
ErrorCode
Trueface::SDK
::
identifyTopCandidate
(const Faceprint &faceprint, Candidate &candidate, bool &found, const float threshold = 0.3f)¶ Get the top candidate identity in the collection and the corresponding similarity score and match probability.
- Return
error code, see ErrorCode.
- Parameters
[in] faceprint
: the template to be identified.[out] candidate
: the top candidate identity.[out] found
: set to true if a match is found.[in] threshold
: the similarity score threshold above which it is considered a match. Higher thresholds may result in faster queries. Refer to https://performance.trueface.ai/ when selecting a threshold.
-
ErrorCode
Trueface::SDK
::
batchIdentifyTopCandidate
(const std::vector<Faceprint> &faceprints, std::vector<Candidate> &candidates, std::vector<bool> &found, const float threshold = 0.3f)¶ Get the top candidate identity in the collection and the corresponding similarity score and match probability for each probe faceprint. Like identifyTopCandidate, but runs search queries in parallel and improves throughput.
- Return
error code, see ErrorCode.
- Parameters
[in] faceprints
: a vector of templates to be identified.[out] candidates
: the top candidate identity for each probe faceprint.[out] found
: set to true if a match is found for the probe faceprint.[in] threshold
: the similarity score threshold above which it is considered a match. Higher thresholds may result in faster queries. Refer to https://performance.trueface.ai/ when selecting a threshold.
-
ErrorCode
Trueface::SDK
::
identifyTopCandidates
(const Faceprint &faceprint, std::vector<Candidate> &candidates, bool &found, const unsigned int numCandidates, const float threshold = 3.f)¶ Get a list of the top n candidate identities in the collection and their corresponding similarity scores and match probabilities.
- Return
error code, see ErrorCode.
- Parameters
[in] faceprint
: the template to be identified.[out] candidates
: a list of the top n matches (or fewer), ordered by descending similarity score.[out] found
: set to true if at leaset one match is found.[in] numCandidates
: max number of candidate identities to return.[in] threshold
: the similarity score threshold above which it is considered a match. Higher thresholds may result in faster queries. Refer to https://performance.trueface.ai/ when selecting a threshold.
-
struct
Trueface
::
Candidate
¶