Skip to content

dnn: fix some tests#18393

Merged
alalek merged 2 commits intoopencv:masterfrom
mshabunin:fix-dnn-test
Sep 23, 2020
Merged

dnn: fix some tests#18393
alalek merged 2 commits intoopencv:masterfrom
mshabunin:fix-dnn-test

Conversation

@mshabunin
Copy link
Copy Markdown
Contributor

@mshabunin mshabunin commented Sep 23, 2020

  • Extracted similar code to a function
  • Check result of map::find

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake
force_builders=Custom,Custom Win,Custom Mac
build_image:Custom=ubuntu-openvino-2020.4.0:16.04
build_image:Custom Win=openvino-2020.4.0
build_image:Custom Mac=openvino-2020.4.0

test_modules:Custom=dnn,python2,python3,java
test_modules:Custom Win=dnn,python2,python3,java
test_modules:Custom Mac=dnn,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=*

"intel/person-detection-retail-0013/FP32/person-detection-retail-0013",
"intel/person-detection-retail-0013/FP16/person-detection-retail-0013"
}},
{ "age-gender-recognition-retail-0013", {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the "how to" comment above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

else if (!isFP16 && modelInfo.modelPathFP32)
return std::string(modelInfo.modelPathFP32);
}
return std::string();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, error with description or skip action should be raised.
Test code should not allow to hide mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted this routine to be separate from testing framework to allow calling it from some static initializer or test fixture constructors. Problems should be caught later by the test body in findDataFile and string::empty() checks.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@alalek alalek merged commit c012490 into opencv:master Sep 23, 2020
@mshabunin mshabunin added the backport is needed Label for maintainers. Authors of PR can ignore this label Sep 24, 2020
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: dnn port/backport done Label for maintainers. Authors of PR can ignore this test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants