public class FaceRecognizerSF extends Object
Modifier and Type | Field and Description |
---|---|
static int |
FR_COSINE |
static int |
FR_NORM_L2 |
protected long |
nativeObj |
Modifier | Constructor and Description |
---|---|
protected |
FaceRecognizerSF(long addr) |
Modifier and Type | Method and Description |
---|---|
static FaceRecognizerSF |
__fromPtr__(long addr) |
void |
alignCrop(Mat src_img,
Mat face_box,
Mat aligned_img)
Aligning image to put face on the standard position
|
static FaceRecognizerSF |
create(String model,
String config)
Creates an instance of this class with given parameters
|
static FaceRecognizerSF |
create(String model,
String config,
int backend_id)
Creates an instance of this class with given parameters
|
static FaceRecognizerSF |
create(String model,
String config,
int backend_id,
int target_id)
Creates an instance of this class with given parameters
|
void |
feature(Mat aligned_img,
Mat face_feature)
Extracting face feature from aligned image
|
protected void |
finalize() |
long |
getNativeObjAddr() |
double |
match(Mat face_feature1,
Mat face_feature2)
Calculating the distance between two face features
|
double |
match(Mat face_feature1,
Mat face_feature2,
int dis_type)
Calculating the distance between two face features
|
protected final long nativeObj
public static final int FR_COSINE
public static final int FR_NORM_L2
public long getNativeObjAddr()
public static FaceRecognizerSF __fromPtr__(long addr)
public void alignCrop(Mat src_img, Mat face_box, Mat aligned_img)
src_img
- input imageface_box
- the detection result used for indicate face in input imagealigned_img
- output aligned imagepublic void feature(Mat aligned_img, Mat face_feature)
aligned_img
- input aligned imageface_feature
- output face featurepublic double match(Mat face_feature1, Mat face_feature2, int dis_type)
face_feature1
- the first input featureface_feature2
- the second input feature of the same size and the same type as face_feature1dis_type
- defining the similarity with optional values "FR_OSINE" or "FR_NORM_L2"public double match(Mat face_feature1, Mat face_feature2)
face_feature1
- the first input featureface_feature2
- the second input feature of the same size and the same type as face_feature1public static FaceRecognizerSF create(String model, String config, int backend_id, int target_id)
model
- the path of the onnx model used for face recognitionconfig
- the path to the config file for compability, which is not requested for ONNX modelsbackend_id
- the id of backendtarget_id
- the id of target devicepublic static FaceRecognizerSF create(String model, String config, int backend_id)
model
- the path of the onnx model used for face recognitionconfig
- the path to the config file for compability, which is not requested for ONNX modelsbackend_id
- the id of backendpublic static FaceRecognizerSF create(String model, String config)
model
- the path of the onnx model used for face recognitionconfig
- the path to the config file for compability, which is not requested for ONNX modelsCopyright © 2024. All rights reserved.