Skip to content

ONNX graphs simplifier - #16291

Merged
opencv-pushbot merged 1 commit into
opencv:3.4from
dkurt:dnn_onnx_graph_simplifier
Jan 14, 2020
Merged

opencv-pushbot merged 1 commit into
opencv:3.4from
dkurt:dnn_onnx_graph_simplifier

Conversation

@dkurt

@dkurt dkurt commented Jan 6, 2020 •

Copy link
Copy Markdown
Member

This pullrequest changes

resolves #15244

Share graphs simplification logic from TensorFlow importer to ONNX importer.

Merge with extra: opencv/opencv_extra#694

force_builders=Custom,Custom Win,Custom Mac
build_image:Custom=ubuntu-openvino-2019r3.0:16.04
build_image:Custom Win=openvino-2019r3.0
build_image:Custom Mac=openvino-2019r3.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=*

Comment thread modules/dnn/src/graph_simplifier.cpp Resolved
Comment thread modules/dnn/src/graph_simplifier.hpp Resolved
std::vector<Ptr<Subgraph> > subgraphs;
subgraphs.push_back(Ptr<Subgraph>(new SoftMaxSubgraph()));

simplifySubgraphs(Ptr<ImportGraphWrapper>(new ONNXGraphWrapper(net)), subgraphs);

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.

makePtr for these 2 cases

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

cannot do it for ONNXGraphWrapper due it uses non-const reference to delete nodes from the net. But makePtr works with const arguments:

template<typename _Tp, typename ... A1> static inline
Ptr<_Tp> makePtr(const A1&... a1) { return std::make_shared<_Tp>(a1...); }

@dkurt
dkurt force-pushed the dnn_onnx_graph_simplifier branch from 09fe8c4 to b610541 Compare January 14, 2020 09:25
@dkurt
dkurt force-pushed the dnn_onnx_graph_simplifier branch from b610541 to c1c84d2 Compare January 14, 2020 09:46

@alalek alalek left a comment

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.

Thank you 👍

@opencv-pushbot
opencv-pushbot merged commit c1c84d2 into opencv:3.4 Jan 14, 2020
@alalek alalek mentioned this pull request Jan 14, 2020
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants