FaceRecognizerSF.fromFile constructor
Creates an instance of this class with given 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
backendId
the id of backend
targetId
the id of target device
Implementation
factory FaceRecognizerSF.fromFile(
String model,
String config, {
int backendId = 0,
int targetId = 0,
}) {
final p = calloc<cvg.FaceRecognizerSF>();
final cModel = model.toNativeUtf8().cast<ffi.Char>();
final cConfig = config.toNativeUtf8().cast<ffi.Char>();
cvRun(() => cffi.FaceRecognizerSF_New(cModel, cConfig, backendId, targetId, p));
calloc.free(cModel);
calloc.free(cConfig);
return FaceRecognizerSF._(p);
}