DNN-based face recognizer.
More...
#include <opencv2/objdetect/face.hpp>
◆ DisType
Definition of distance used for calculating the distance between two face features.
Enumerator |
---|
FR_COSINE | |
FR_NORM_L2 | |
◆ ~FaceRecognizerSF()
virtual cv::FaceRecognizerSF::~FaceRecognizerSF |
( |
| ) |
|
|
inlinevirtual |
◆ alignCrop()
Python: |
---|
| cv.FaceRecognizerSF.alignCrop( | src_img, face_box[, aligned_img] | ) -> | aligned_img |
Aligns detected face with the source input image and crops it.
- Parameters
-
src_img | input image |
face_box | the detected face result from the input image |
aligned_img | output aligned image |
◆ create() [1/2]
static Ptr< FaceRecognizerSF > cv::FaceRecognizerSF::create |
( |
const String & |
framework, |
|
|
const std::vector< uchar > & |
bufferModel, |
|
|
const std::vector< uchar > & |
bufferConfig, |
|
|
int |
backend_id = 0 , |
|
|
int |
target_id = 0 |
|
) |
| |
|
static |
Python: |
---|
| cv.FaceRecognizerSF.create( | model, config[, backend_id[, target_id]] | ) -> | retval |
| cv.FaceRecognizerSF.create( | framework, bufferModel, bufferConfig[, backend_id[, target_id]] | ) -> | retval |
| cv.FaceRecognizerSF_create( | model, config[, backend_id[, target_id]] | ) -> | retval |
| cv.FaceRecognizerSF_create( | framework, bufferModel, bufferConfig[, backend_id[, target_id]] | ) -> | retval |
Creates an instance of this class from a buffer containing the model weights and configuration.
- Parameters
-
framework | Name of the framework (ONNX, etc.) |
bufferModel | A buffer containing the binary model weights. |
bufferConfig | A buffer containing the network configuration. |
backend_id | The id of the backend. |
target_id | The id of the target device. |
- Returns
- A pointer to the created instance of FaceRecognizerSF.
◆ create() [2/2]
Python: |
---|
| cv.FaceRecognizerSF.create( | model, config[, backend_id[, target_id]] | ) -> | retval |
| cv.FaceRecognizerSF.create( | framework, bufferModel, bufferConfig[, backend_id[, target_id]] | ) -> | retval |
| cv.FaceRecognizerSF_create( | model, config[, backend_id[, target_id]] | ) -> | retval |
| cv.FaceRecognizerSF_create( | framework, bufferModel, bufferConfig[, backend_id[, target_id]] | ) -> | retval |
Creates an instance of this class with given parameters.
- Parameters
-
model | the path of the onnx model used for face recognition |
config | the path to the config file for compability, which is not requested for ONNX models |
backend_id | the id of backend |
target_id | the id of target device |
◆ feature()
Python: |
---|
| cv.FaceRecognizerSF.feature( | aligned_img[, face_feature] | ) -> | face_feature |
Extracts face feature from aligned image.
- Parameters
-
aligned_img | input aligned image |
face_feature | output face feature |
◆ match()
Python: |
---|
| cv.FaceRecognizerSF.match( | face_feature1, face_feature2[, dis_type] | ) -> | retval |
Calculates the distance between two face features.
- Parameters
-
face_feature1 | the first input feature |
face_feature2 | the second input feature of the same size and the same type as face_feature1 |
dis_type | defines how to calculate the distance between two face features with optional values "FR_COSINE" or "FR_NORM_L2" |
The documentation for this class was generated from the following file: