G-API MTCNN demo hotfix to align overall pipeline accuracy with the reference Python code output.#20065
Conversation
|
I think, sample should have another name, because this isn't simple face detection, this is MTCNN face detection. |
|
@mpashchenkov I think it's to late to change name of already published sample. This PR is just hot fix. |
| const float* reg_data = regressions.ptr<float>(); | ||
|
|
||
| auto out_side = std::max(h, w); | ||
| auto in_side = 2 * out_side + 11; |
There was a problem hiding this comment.
There was a problem hiding this comment.
The same as the original demo
| float bboxWidth = static_cast<float>(x2 - x1); | ||
| float bboxHeight = static_cast<float>(y2 - y1); | ||
| float side = std::max(bboxWidth, bboxHeight); | ||
| bbox.x1 = static_cast<int>(static_cast<float>(x1) + (bboxWidth - side) * 0.5f); |
There was a problem hiding this comment.
What if side = bboxHeight and x1 will be less 0? It is out of image bbox.
There was a problem hiding this comment.
There was a problem hiding this comment.
The same as the original demo
dmatveev
left a comment
There was a problem hiding this comment.
@TolyaTalamanov @mpashchenkov do you have any other feedback here? Probably we should go ahead w/the merge
| const float interX1 = std::max(static_cast<float>(faces[idx].bbox.x1), static_cast<float>(faces[tmpIdx].bbox.x1)); | ||
| const float interY1 = std::max(static_cast<float>(faces[idx].bbox.y1), static_cast<float>(faces[tmpIdx].bbox.y1)); | ||
| const float interX2 = std::min(static_cast<float>(faces[idx].bbox.x2), static_cast<float>(faces[tmpIdx].bbox.x2)); | ||
| const float interY2 = std::min(static_cast<float>(faces[idx].bbox.y2), static_cast<float>(faces[tmpIdx].bbox.y2)); |
There was a problem hiding this comment.
probably static_cast<float> can be applied only once on the result of std::min or std::max.
|
Please, move tm.start() to 747 line. This step include cv::imshow and kill part of performance. |
|
@alalek can we merge it? |
…mo_PR_hotfix2 G-API MTCNN demo hotfix to align overall pipeline accuracy with the reference Python code output. * MTCNN G-API demo aligned with Python from OMZ * clean up * more comments from Maxim are addressed. * address comment from Dmitry
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.
force_builders=Custom,Custom Win,Custom Mac
build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f
build_image:Custom=centos:7
buildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f
Xbuild_image:Custom=ubuntu-openvino-2020.3.0:16.04
build_image:Custom Win=openvino-2021.3.0
build_image:Custom Mac=openvino-2021.3.0
test_modules:Custom=gapi,python2,python3,java
test_modules:Custom Win=gapi,python2,python3,java
test_modules:Custom Mac=gapi,python2,python3,java
buildworker:Custom=linux-1
// disabled due high memory usage: test_opencl:Custom=ON
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*