digiKam
Digikam::DNNFaceExtractor Class Reference

Public Member Functions

cv::Mat alignFace (const cv::Mat &inputImage) const
 
 DNNFaceExtractor ()
 
 DNNFaceExtractor (const DNNFaceExtractor &)
 
cv::Mat getFaceEmbedding (const cv::Mat &faceImage)
 
bool loadModels ()
 
 ~DNNFaceExtractor ()
 

Static Public Member Functions

static double cosineDistance (std::vector< float > v1, std::vector< float > v2)
 
static std::vector< float > decodeVector (const QJsonArray &json)
 
static QJsonArray encodeVector (const std::vector< float > &vector)
 
static double L2squareDistance (std::vector< float > v1, std::vector< float > v2)
 
static double L2squareNormDistance (std::vector< float > v1, std::vector< float > v2)
 
static cv::Mat vectortomat (const std::vector< float > &vector)
 

Constructor & Destructor Documentation

◆ DNNFaceExtractor() [1/2]

Digikam::DNNFaceExtractor::DNNFaceExtractor ( )
explicit

References loadModels().

◆ DNNFaceExtractor() [2/2]

Digikam::DNNFaceExtractor::DNNFaceExtractor ( const DNNFaceExtractor other)

◆ ~DNNFaceExtractor()

Digikam::DNNFaceExtractor::~DNNFaceExtractor ( )

Member Function Documentation

◆ alignFace()

cv::Mat Digikam::DNNFaceExtractor::alignFace ( const cv::Mat &  inputImage) const

◆ cosineDistance()

double Digikam::DNNFaceExtractor::cosineDistance ( std::vector< float >  v1,
std::vector< float >  v2 
)
static

Calculate different between 2 vectors

◆ decodeVector()

std::vector< float > Digikam::DNNFaceExtractor::decodeVector ( const QJsonArray &  json)
static

◆ encodeVector()

QJsonArray Digikam::DNNFaceExtractor::encodeVector ( const std::vector< float > &  vector)
static

◆ getFaceEmbedding()

cv::Mat Digikam::DNNFaceExtractor::getFaceEmbedding ( const cv::Mat &  faceImage)

◆ L2squareDistance()

double Digikam::DNNFaceExtractor::L2squareDistance ( std::vector< float >  v1,
std::vector< float >  v2 
)
static

◆ L2squareNormDistance()

double Digikam::DNNFaceExtractor::L2squareNormDistance ( std::vector< float >  v1,
std::vector< float >  v2 
)
static

◆ loadModels()

bool Digikam::DNNFaceExtractor::loadModels ( )

Read pretrained neural network for face recognition.

References Digikam::OPENFACE.

Referenced by DNNFaceExtractor().

◆ vectortomat()

cv::Mat Digikam::DNNFaceExtractor::vectortomat ( const std::vector< float > &  vector)
static

Convert face embedding between different formats


The documentation for this class was generated from the following files: