fromFileAsync static method

Future<FaceRecognizerSF> fromFileAsync(
  1. String model,
  2. String config, {
  3. int backendId = 0,
  4. int targetId = 0,
})

Implementation

static Future<FaceRecognizerSF> fromFileAsync(
  String model,
  String config, {
  int backendId = 0,
  int targetId = 0,
}) async {
  final cModel = model.toNativeUtf8().cast<ffi.Char>();
  final cConfig = config.toNativeUtf8().cast<ffi.Char>();
  final rval = await cvRunAsync<FaceRecognizerSF>(
      (callback) => cobjdetect.FaceRecognizerSF_New_Async(
            cModel,
            cConfig,
            backendId,
            targetId,
            callback,
          ), (c, p) {
    return c.complete(FaceRecognizerSF.fromPointer(p.cast<cobjdetect.FaceRecognizerSF>()));
  });
  calloc.free(cModel);
  calloc.free(cConfig);
  return rval;
}