Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
rainyl committed Jun 30, 2024
1 parent feb2427 commit 7d582f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/src/objdetect/objdetect_async.dart
Original file line number Diff line number Diff line change
Expand Up @@ -601,12 +601,14 @@ extension FaceDetectorYNAsync on FaceDetectorYN {
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,
VecUChar.fromList(bufferModel).ref,
VecUChar.fromList(bufferConfig).ref,
bufM.ref,
bufC.ref,
inputSize.cvd.ref,
scoreThreshold,
nmsThreshold,
Expand All @@ -618,6 +620,8 @@ extension FaceDetectorYNAsync on FaceDetectorYN {
return c.complete(FaceDetectorYN.fromPointer(p.cast<cvg.FaceDetectorYN>()));
});
calloc.free(cFramework);
bufM.dispose();
bufC.dispose();

return rval;
}
Expand Down

0 comments on commit 7d582f2

Please sign in to comment.