-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
[proposal] Refactoring for FaceDetectorYN/FaceRecgnizer #20874
Description
System information (version)
- OpenCV => 4.5.4
Detailed description
This is proposal. Let's discuss.
-
Move
cv::FaceDetectorYN/cv::FaceRecgnizerto DNN module from ObjDetect module
Currently,cv::FaceDetectorYN/cv::FaceRecgnizerSFis implemented in the ObjDetect module.
cv::FaceDetectorYN/cv::FaceRecgnizeris a high-level API for face detection and recognition.
So, I think it is natural to have it in the DNN module. I suggest move this. -
Re-implementation to high-level API extended from
cv::dnn::Model
All high-level APIs in DNN modules inherit fromcv::dnn::Model.
cv::FaceDetectorYN/cv::FaceRecgnizerSFshould also be re-implemented to inherit fromcv::dnn::Model.
It is different post processing depending on models. For example, YuNet and OpenCV Face Detector.
It is better to implement likecv::dnn::TextDetectionModel->cv::dnn::TextDetectionModel_DBandcv::dnn::TextDetectionModel->cv::dnn::TextDetectionModel_EAST, as in text detection model. -
Support for OpenCV Face Detector
It should add a high-level API that supports the traditional OpenCV Face Detector.
Until now, users have been using thecv::dnn::DetectionModelto using OpenCV Face Detector with high-level API.
There was no hight-level API for face detection. I think we should take this opportunity to create one.
cv::dnn::FaceDetectionModel->cv::dnn::FaceDetectionModel_OpenCV(Alternatively, it could be namedcv::dnn::FaceDetectionModel_SSDbecause OpenCV Face Detector is SSD.) andcv::dnn::FaceDetectionModel->cv::dnn::FaceDetectionModel_YN. -
Change the output format of
cv::FaceDetectorYN
Currently,cv::FaceDetectorYNoutputs the bounding box, landmarks, and confidence score in a single Mat. It is not user friendly.
For example, in thecv::dnn::ObjectDetectionModel, the bounding box, class id, and confidence score are output in the respective Mat.
cv::FaceDetectorYNshould also output the bounding box, landmarks, and confidence score to each Mat.