fromFileAsync static method

Future<FaceDetectorYN> fromFileAsync(
  1. String model,
  2. String config,
  3. (int, int) inputSize, {
  4. double scoreThreshold = 0.9,
  5. double nmsThreshold = 0.3,
  6. int topK = 5000,
  7. int backendId = 0,
  8. int targetId = 0,
})

Implementation

static Future<FaceDetectorYN> fromFileAsync(
  String model,
  String config,
  (int, int) inputSize, {
  double scoreThreshold = 0.9,
  double nmsThreshold = 0.3,
  int topK = 5000,
  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<FaceDetectorYN>(
      (callback) => cobjdetect.FaceDetectorYN_New_Async(
            cModel,
            cConfig,
            inputSize.cvd.ref,
            scoreThreshold,
            nmsThreshold,
            topK,
            backendId,
            targetId,
            callback,
          ), (c, p) {
    return c.complete(FaceDetectorYN.fromPointer(p.cast<cobjdetect.FaceDetectorYN>()));
  });
  calloc.free(cModel);
  calloc.free(cConfig);
  return rval;
}