FaceDetectorYN.fromFile constructor
FaceDetectorYN.fromFile(})
Creates an instance of face detector class with given parameters.
model
the path to the requested model
config
the path to the config file for compability, which is not requested for ONNX models
inputSize
the size of the input image
scoreThreshold
the threshold to filter out bounding boxes of score smaller than the given value
nmsThreshold
the threshold to suppress bounding boxes of IoU bigger than the given value
topK
keep top K bboxes before NMS
backendId
the id of backend
targetId
the id of target device
https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#a5f7fb43c60c95ca5ebab78483de02516
Implementation
factory FaceDetectorYN.fromFile(
String model,
String config,
(int, int) inputSize, {
double scoreThreshold = 0.9,
double nmsThreshold = 0.3,
int topK = 5000,
int backendId = 0,
int targetId = 0,
}) {
final p = calloc<cobjdetect.FaceDetectorYN>();
final cModel = model.toNativeUtf8().cast<ffi.Char>();
final cConfig = config.toNativeUtf8().cast<ffi.Char>();
cvRun(
() => cobjdetect.FaceDetectorYN_New(
cModel,
cConfig,
inputSize.cvd.ref,
scoreThreshold,
nmsThreshold,
topK,
backendId,
targetId,
p,
),
);
calloc.free(cModel);
calloc.free(cConfig);
return FaceDetectorYN._(p);
}