Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
Implement ArgMax and ArgMin#20733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
asmorkalov commentedOct 18, 2021
@alalek could you look at the PR? |
vpisarev commentedNov 12, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The names of functions are too generic and thus quite confusing. There is minMaxLoc() that finds global minimum and maximum together with their locations. If we don't want to make reduce() heavier, maybe, let's split reduce() into multiple functions and add two more: reduceArgMin() and reduceArgMax(). |
5bdb9ec to0be4f3fCompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
modules/ts/src/ts_func.cpp Outdated
| #include<float.h> | ||
| #include<limits.h> | ||
| #include"opencv2/imgproc/types_c.h" | ||
| #include"../src/utils/depth_dispatch.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It makes sense to put this header intocore/include/ instead ofcore/src/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Can you help me identify the correct naming/subfolder, so that this header doesn't leak to the public API?reduce_arg.private.hpp incore/include/opecv2/core/utils or.../private doesn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
leak to the public API
What do you mean?
- documentation? - look for
//! @cond IGNOREDfor the whole file - install directory? - AFAIK, "private/" handles that.
Implementation itself should be marked as "static inline" (it is template anyway) and may be placed intocv::detail namespace.
- "core/utils/" - contains low level / system utility functions (not a good place)
- "core/detail/" - good candidate
- just "opencv2/core/" should work too (but don't include that into core.hpp or base.hpp)
Preferable name is "dispatch_helper.impl.hpp".
Uh oh!
There was an error while loading.Please reload this page.
alalek left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you for update!
modules/core/include/opencv2/core/detail/reduce_arg_helper.impl.hpp OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
alalek left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you for update! Looks good to me 👍
modules/core/include/opencv2/core/detail/dispatch_helper.impl.hpp OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
modules/core/perf/perf_reduce.cpp Outdated
| typedef tuple<Size, MatType,int> Size_MatType_RMode_t; | ||
| typedef perf::TestBaseWithParam<Size_MatType_RMode_t> Size_MatType_RMode; | ||
| PERF_TEST_P(Size_MatType_RMode, reduceArgMinMax, testing::Combine( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do we really need performance tests now? Can we disable them by default (DISABLED_reduceArgMinMax)?
- what is about 3D / 4D layouts? (DNN doesn't use 2D matrices in general)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
3D/4D layouts perform similarly if the number of pixels is the same.
Implement ArgMax and ArgMin* add reduceArgMax and reduceArgMin* fix review comments* address review concerns
Uh oh!
There was an error while loading.Please reload this page.
Related#20679
Pull Request Readiness Checklist
See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.