fromBufferAsync static method
Future<FaceDetectorYN>
fromBufferAsync(
- String framework,
- Uint8List bufferModel,
- Uint8List bufferConfig,
- (int, int) inputSize, {
- double scoreThreshold = 0.9,
- double nmsThreshold = 0.3,
- int topK = 5000,
- int backendId = 0,
- int targetId = 0,
})
Implementation
static Future<FaceDetectorYN> fromBufferAsync(
String framework,
Uint8List bufferModel,
Uint8List bufferConfig,
(int, int) inputSize, {
double scoreThreshold = 0.9,
double nmsThreshold = 0.3,
int topK = 5000,
int backendId = 0,
int targetId = 0,
}) async {
final cFramework = framework.toNativeUtf8().cast<ffi.Char>();
final bufM = VecUChar.fromList(bufferModel);
final bufC = VecUChar.fromList(bufferConfig);
final rval = await cvRunAsync<FaceDetectorYN>(
(callback) => cffi.FaceDetectorYN_NewFromBuffer_Async(
cFramework,
bufM.ref,
bufC.ref,
inputSize.cvd.ref,
scoreThreshold,
nmsThreshold,
topK,
backendId,
targetId,
callback,
), (c, p) {
return c.complete(FaceDetectorYN.fromPointer(p.cast<cvg.FaceDetectorYN>()));
});
calloc.free(cFramework);
bufM.dispose();
bufC.dispose();
return rval;
}