Skip to content

Supported ONNX Squeeze, ReduceL2 and Eltwise::DIV#15811

Merged
alalek merged 6 commits intoopencv:3.4from
l-bat:eltwise_div
Nov 9, 2019
Merged

Supported ONNX Squeeze, ReduceL2 and Eltwise::DIV#15811
alalek merged 6 commits intoopencv:3.4from
l-bat:eltwise_div

Conversation

@l-bat
Copy link
Copy Markdown
Contributor

@l-bat l-bat commented Oct 30, 2019

Related: #15251
Merge with extra: opencv/opencv_extra#683

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
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*

else if (layer_type == "ReduceL2")
{
CV_Assert(node_proto.input_size() == 1);
CV_Assert(graph_proto.node(li + 1).op_type() == "Div");
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 check that node_size more than li first:

CV_Assert(graph_proto.node_size() > li && graph_proto.node(li + 1).op_type() == "Div");

++li;

layerParams.type = "Normalize";
layerParams.set("p", 2);
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.

"p" is 2 by default

for (int j = 1; j < axes.size(); ++j) {
CV_Assert(axes[j - 1] + 1 == axes[j]);
}
}
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.

Can we avoid using this code? I mean keep default values of Normalize layer

if (constBlobs.find(node_proto.input(1)) == constBlobs.end()) {
layerParams.type = "Eltwise";
layerParams.set("operation", "div");
} else {
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 format it in this way:

if
{
}
else
{
}

Copy link
Copy Markdown
Member

@dkurt dkurt left a comment

Choose a reason for hiding this comment

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

Great! Thank you.

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.

3 participants