Merge pull request #20422 from fengyuentau:dnn_face
authorYuantao Feng <yuantao.feng@outlook.com>
Fri, 8 Oct 2021 19:13:49 +0000 (03:13 +0800)
committerGitHub <noreply@github.com>
Fri, 8 Oct 2021 19:13:49 +0000 (19:13 +0000)
commit34d359fe035a92d48a399c6e6975c77513bd5139
tree3b72146005f16133aec1ee9c4cf6897dcaf26d74
parent4672dbda2a1bdebb476c0dacbeb8c0d0842b21d1
Merge pull request #20422 from fengyuentau:dnn_face

Add DNN-based face detection and face recognition into modules/objdetect

* Add DNN-based face detector impl and interface

* Add a sample for DNN-based face detector

* add recog

* add notes

* move samples from samples/cpp to samples/dnn

* add documentation for dnn_face

* add set/get methods for input size, nms & score threshold and topk

* remove the DNN prefix from the face detector and face recognizer

* remove default values in the constructor of impl

* regenerate priors after setting input size

* two filenames for readnet

* Update face.hpp

* Update face_recognize.cpp

* Update face_match.cpp

* Update face.hpp

* Update face_recognize.cpp

* Update face_match.cpp

* Update face_recognize.cpp

* Update dnn_face.markdown

* Update dnn_face.markdown

* Update face.hpp

* Update dnn_face.markdown

* add regression test for face detection

* remove underscore prefix; fix warnings

* add reference & acknowledgement for face detection

* Update dnn_face.markdown

* Update dnn_face.markdown

* Update ts.hpp

* Update test_face.cpp

* Update face_match.cpp

* fix a compile error for python interface; add python examples for face detection and recognition

* Major changes for Vadim's comments:

* Replace class name FaceDetector with FaceDetectorYN in related failes

* Declare local mat before loop in modules/objdetect/src/face_detect.cpp

* Make input image and save flag optional in samples/dnn/face_detect(.cpp, .py)

* Add camera support in samples/dnn/face_detect(.cpp, .py)

* correct file paths for regression test

* fix convertion warnings; remove extra spaces

* update face_recog

* Update dnn_face.markdown

* Fix warnings and errors for the default CI reports:

* Remove trailing white spaces and extra new lines.

* Fix convertion warnings for windows and iOS.

* Add braces around initialization of subobjects.

* Fix warnings and errors for the default CI systems:

* Add prefix 'FR_' for each value name in enum DisType to solve the
redefinition error for iOS compilation; Modify other code accordingly

* Add bookmark '#tutorial_dnn_face' to solve warnings from doxygen

* Correct documentations to solve warnings from doxygen

* update FaceRecognizerSF

* Fix the error for CI to find ONNX models correctly

* add suffix f to float assignments

* add backend & target options for initializing face recognizer

* add checkeq for checking input size and preset size

* update test and threshold

* changes in response to alalek's comments:

* fix typos in samples/dnn/face_match.py

* import numpy before importing cv2

* add documentation to .setInputSize()

* remove extra include in face_recognize.cpp

* fix some bugs

* Update dnn_face.markdown

* update thresholds; remove useless code

* add time suffix to YuNet filename in test

* objdetect: update test code
17 files changed:
doc/tutorials/dnn/dnn_face/dnn_face.markdown [new file with mode: 0644]
doc/tutorials/dnn/dnn_text_spotting/dnn_text_spotting.markdown
doc/tutorials/dnn/table_of_content_dnn.markdown
modules/objdetect/CMakeLists.txt
modules/objdetect/include/opencv2/objdetect.hpp
modules/objdetect/include/opencv2/objdetect/face.hpp [new file with mode: 0644]
modules/objdetect/src/face_detect.cpp [new file with mode: 0644]
modules/objdetect/src/face_recognize.cpp [new file with mode: 0644]
modules/objdetect/test/test_face.cpp [new file with mode: 0644]
modules/objdetect/test/test_main.cpp
modules/ts/include/opencv2/ts.hpp
samples/dnn/CMakeLists.txt
samples/dnn/face_detect.cpp [new file with mode: 0644]
samples/dnn/face_detect.py [new file with mode: 0644]
samples/dnn/face_match.cpp [new file with mode: 0644]
samples/dnn/face_match.py [new file with mode: 0644]
samples/dnn/results/audrybt1.jpg [new file with mode: 0644]