| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
Digikam::IdentityProvider Class Reference
Inheritance diagram for Digikam::IdentityProvider:

## Public Member Functions
Identity | addIdentity (const QMultiMap< QString, QString > &attributes)
| Adds a new identity with the specified attributes.
Identity | addIdentityDebug (const QMultiMap< QString, QString > &attributes)
| This is the debug version of addIdentity, so the identity is only added to identityCache, but not into the recognition database.
int | addTraining (const Identity &identity, const QString &hash, const cv::Mat &feature)
| Add the face features and hash to the recognition DB.
const QList< Identity > | allIdentities () const
void | cancel ()
bool | checkRetrainingRequired () const
void | clearAllTraining ()
| Clears all identities and face training from the recognition DB.
bool | clearTraining (const QString &hash)
| Deletes the training image for the given hash, leaving the identity as such in the database.
void | deleteIdentities (QList< Identity > identitiesToBeDeleted)
| Deletes a list of identities from the database.
void | deleteIdentity (const Identity &identityToBeDeleted)
| Deletes an identity from the database.
Identity | findIdentity (const QMultiMap< QString, QString > &attributes) const
| Finds the identity matching the given attributes.
Identity | findIdentity (const QString &attribute, const QString &value) const
| Finds the first identity with matching attribute - value.
Identity | identity (int id) const
| retrieves the identity with the given id.
bool | integrityCheck ()
| Checks the integrity and returns true if everything is fine.
bool | isValidId (int label) const
| Checks if the id exists in the recognition DB.
void | renameIdentity (const QString &uuid, const QString &newName)
| Renames an identity.
void | vacuum ()
| Shrinks the database.

## Static Public Member Functions
static IdentityProvider * | instance ()

## Static Public Attributes
static QString | ExtractorModel = QLatin1String("SFace")
static QString | FaceTrainingVersion = QLatin1String("8.6.0")

## Protected Member Functions
bool | addIdentityFace (const Identity &identity, QString &hash, cv::Mat embedding)
| add a face matrice to the recognition database
bool | deleteIdentityFace (const Identity &identity, QString &hash)
| delete a face matrice from the recognition database
cv::Ptr< cv::ml::TrainData > | getTrainingData () const
| Deletes a list of identities from the database.
bool | initialize ()
| Initializes the identity provider.

## Friends
class | FaceClassifier
class | Identity

## Member Function Documentation

## ◆ addIdentity()

Identity Digikam::IdentityProvider::addIdentity | ( | const QMultiMap< QString, QString > & | attributes | ) |

Please note that a UUID is automatically generated.

## ◆ addTraining()

int Digikam::IdentityProvider::addTraining | ( | const Identity & | identity,
|  | const QString & | hash,
|  | const cv::Mat & | feature
| ) |  |

Returns
  the ID of the new row

## ◆ allIdentities()

const QList< Identity > Digikam::IdentityProvider::allIdentities | ( |  | ) | const

Returns
  all identities known to the database

## ◆ findIdentity() [1/2]

Identity Digikam::IdentityProvider::findIdentity | ( | const QMultiMap< QString, QString > & | attributes | ) | const

Attributes are first checked with knowledge of their meaning. Secondly, all unknown attributes are used.

Returns
  a null Identity if no match is possible or the map is empty.

## ◆ findIdentity() [2/2]

Identity Digikam::IdentityProvider::findIdentity | ( | const QString & | attribute,
|  | const QString & | value
| ) |  | const

Returns
  a null identity if no match is found or attribute is empty.

## ◆ renameIdentity()

void Digikam::IdentityProvider::renameIdentity | ( | const QString & | uuid,
|  | const QString & | newName
| ) |  |

Fails if the new name is already in use.