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
* Fix gst error handling
* Use the return value instead of the error, which gives no guarantee of being NULL in case of error
* Test err pointer before accessing it
* Remove unreachable code
* videoio(gstreamer): restore check in writer code
Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
Fix ORB integer overflow
* set size_t step to fix integer overflow in ptr0 offset
* added issue_537 test
* minor fix tags, points
* added size_t_step and offset to remove mixed unsigned and signed operations
* features2d: update ORB checks
Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
* dnn: fix unaligned memory access crash on armv7
The getTensorContent function would return a Mat pointing to some
member of a Protobuf-encoded message. Protobuf does not make any
alignment guarantees, which results in a crash on armv7 when loading
models while bit 2 is set in /proc/cpu/alignment (or the relevant
kernel feature for alignment compatibility is disabled). Any read
attempt from the previously unaligned data member would send SIGBUS.
As workaround, this commit makes an aligned copy via existing clone
functionality in getTensorContent. The unsafe copy=false option is
removed. Unfortunately, a rather crude hack in PReLUSubgraph in fact
writes(!) to the Protobuf message. We limit ourselves to fixing the
alignment issues in this commit, and add getTensorContentRefUnaligned
to cover the write case with a safe memcpy. A FIXME marks the issue.
* dnn: reduce amount of .clone() calls
* dnn: update FIXME comment
Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>