FaceRecognizerSF.fromFile constructor

FaceRecognizerSF.fromFile(
  1. String model,
  2. String config, {
  3. int backendId = 0,
  4. int targetId = 0,
})

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

https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#a04df90b0cd7d26d350acd92621a35743

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(() => cobjdetect.cv_FaceRecognizerSF_create(cModel, cConfig, backendId, targetId, p));
  calloc.free(cModel);
  calloc.free(cConfig);
  return FaceRecognizerSF._(p);
}