fromFileAsync static method
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;
}