Class FaceDetectorYN
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
DNN-based face detector
public class FaceDetectorYN : DisposableCvObject, IDisposable, ICvPtrHolder
- Inheritance
-
FaceDetectorYN
- Implements
- Inherited Members
Constructors
FaceDetectorYN(nint)
Creates instance by raw pointer cv::FaceDetectorYN*
protected FaceDetectorYN(nint p)
Parameters
pnint
Methods
Create(string, string, Size, float, float, int, Backend, Target)
Creates an instance of this class with given parameters.
public static FaceDetectorYN Create(string model, string config, Size inputSize, float scoreThreshold = 0.9, float nmsThreshold = 0.3, int topK = 5000, Backend backendId = Backend.DEFAULT, Target targetId = Target.CPU)
Parameters
modelstringThe path to the requested model
configstringThe path to the config file for compatibility, which is not requested for ONNX models
inputSizeSizeThe size of the input image
scoreThresholdfloatThe threshold to filter out bounding boxes of score smaller than the given value
nmsThresholdfloatThe threshold to suppress bounding boxes of IoU bigger than the given value
topKintKeep top K bboxes before NMS
backendIdBackendThe id of backend
targetIdTargetThe id of target device
Returns
Detect(Mat, Mat)
A simple interface to detect face from given image.
public int Detect(Mat image, Mat faces)
Parameters
Returns
- int
1 if detection is successful, 0 otherwise.
DisposeManaged()
Releases managed resources
protected override void DisposeManaged()