Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ONNX diagnostic tool corrections#19693

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

Merged
alalek merged 5 commits intoopencv:masterfromLupusSanctus:onnx_diagnostic
Mar 29, 2021

Conversation

@LupusSanctus
Copy link

@LupusSanctusLupusSanctus commentedMar 8, 2021
edited
Loading

Relates to: PR#19420

  • 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

@LupusSanctusLupusSanctus changed the titleWIP: ONNX diagnostic tool correctionsONNX diagnostic tool correctionsMar 9, 2021

CV_Assert(!model.empty());

setDiagnosticsRun(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

it's not good to alter DNN behaviour by setting a global variable. It would be better to have an overloaded variant of readNet() that will pass the corresponding flags to the importers w/o affecting global state.

Copy link
Member

@alalekalalekMar 12, 2021
edited
Loading

Choose a reason for hiding this comment

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

I prefer adding global variable instead of exploding of public API.
API parameters should cover regular usage and don't confuse users.

It is some kind of logging utilities. Even in functional world nobody brings logger instance parameter into each function.


This approach allows to keep this patch small.

LupusSanctus reacted with thumbs up emoji
//! Unregisters registered layer with specified type name. Thread-safe.
staticvoidunregisterLayer(const String &type);

staticconst std::map<String,int>&getRegisteredLayers() {return registeredTypes; }
Copy link
Member

Choose a reason for hiding this comment

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

std::map<String, int>

Why do we needstd::map here?
Can we use simplestd::vector<std::string> here?

Copy link
Author

Choose a reason for hiding this comment

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

Removed this map, reused already existingLayerFactory_Impl map (moved it into private header), it has the same content.

staticvoidunregisterLayer(const String &type);

//! Get the types of layers which were registered.
staticconst std::map<String,int>&getRegisteredLayers();
Copy link
Member

Choose a reason for hiding this comment

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

std::map<String, int>

Why do we needstd::map in public API? Usestd::vector instead.

String

Usestd::string in new API.


If you need to optimize access withO(log(N)) insteadO(N), then buildstd::set / hash_map / etc internally. Do not expose that to public API.


std::set does not work with OpenCV bindings, so it should be avoided in public API.

LupusSanctus reacted with thumbs up emoji
Copy link
Author

@LupusSanctusLupusSanctusMar 23, 2021
edited
Loading

Choose a reason for hiding this comment

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

@alalek, corrected, reused already existingLayerFactory_Impl.


private:
LayerFactory();
static std::map<String,int>&_getRegisteredLayers();
Copy link
Member

Choose a reason for hiding this comment

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

Remove that from public headers.
All "private" members should be eliminated from public header, seehttps://github.com/opencv/opencv/wiki/Coding_Style_Guide

LupusSanctus reacted with thumbs up emoji
Copy link
Author

Choose a reason for hiding this comment

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

Corrected, addedlayer_reg.private.hpp.

@LupusSanctusLupusSanctusforce-pushed theonnx_diagnostic branch 5 times, most recently fromd81f111 to4144e70CompareMarch 26, 2021 17:11
@LupusSanctus
Copy link
Author

@alalek, corrected code, required tests passed.

@alalek
Copy link
Member

Please update changelog highlights too:https://github.com/opencv/opencv/wiki/ChangeLog#version452

@alalekalalek merged commite08de11 intoopencv:masterMar 29, 2021
@alalekalalek mentioned this pull requestApr 9, 2021
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull requestMar 30, 2023
ONNX diagnostic tool* Final* Add forgotten Normalize layer to the set of supported types* ONNX diagnostic tool corrections* Fixed CI test warnings* Added code minor correctionsCo-authored-by: Sergey Slashchinin <sergei.slashchinin@xperience.ai>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vpisarevvpisarevvpisarev left review comments

@alalekalalekalalek left review comments

@asmorkalovasmorkalovasmorkalov approved these changes

Assignees

@asmorkalovasmorkalov

Labels

Projects

None yet

Milestone

4.5.2

Development

Successfully merging this pull request may close these issues.

5 participants

@LupusSanctus@alalek@vpisarev@asmorkalov@sl-sergei

[8]ページ先頭

©2009-2025 Movatter.jp