Skip to content

[proposal] Refactoring for FaceDetectorYN/FaceRecgnizer #20874

@UnaNancyOwen

Description

@UnaNancyOwen
System information (version)
  • OpenCV => 4.5.4
Detailed description

This is proposal. Let's discuss.

  • Move cv::FaceDetectorYN/cv::FaceRecgnizer to DNN module from ObjDetect module
    Currently, cv::FaceDetectorYN/cv::FaceRecgnizerSF is implemented in the ObjDetect module.
    cv::FaceDetectorYN/cv::FaceRecgnizer is 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 from cv::dnn::Model.
    cv::FaceDetectorYN/cv::FaceRecgnizerSF should also be re-implemented to inherit from cv::dnn::Model.
    It is different post processing depending on models. For example, YuNet and OpenCV Face Detector.
    It is better to implement like cv::dnn::TextDetectionModel->cv::dnn::TextDetectionModel_DB and cv::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 the cv::dnn::DetectionModel to 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 named cv::dnn::FaceDetectionModel_SSD because OpenCV Face Detector is SSD.) and cv::dnn::FaceDetectionModel->cv::dnn::FaceDetectionModel_YN.

  • Change the output format of cv::FaceDetectorYN
    Currently, cv::FaceDetectorYN outputs the bounding box, landmarks, and confidence score in a single Mat. It is not user friendly.
    For example, in the cv::dnn::ObjectDetectionModel, the bounding box, class id, and confidence score are output in the respective Mat.
    cv::FaceDetectorYN should also output the bounding box, landmarks, and confidence score to each Mat.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions