1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2021-01-16 19:03:42 +00:00
9 changed files with 80 additions and 10 deletions
@@ -314,6 +314,19 @@ public:
}
};
class MishSubgraph : public Subgraph
{
public:
MishSubgraph()
{
int input = addNodeToMatch("");
int softplus = addNodeToMatch("Softplus", input);
int tanh = addNodeToMatch("Tanh", softplus);
addNodeToMatch("Mul", input, tanh);
setFusedNode("Mish", input);
}
};
class MulCastSubgraph : public Subgraph
{
public:
@@ -512,6 +525,7 @@ void simplifySubgraphs(opencv_onnx::GraphProto& net)
subgraphs.push_back(makePtr<BatchNormalizationSubgraph1>());
subgraphs.push_back(makePtr<BatchNormalizationSubgraph2>());
subgraphs.push_back(makePtr<ExpandSubgraph>());
subgraphs.push_back(makePtr<MishSubgraph>());
simplifySubgraphs(Ptr<ImportGraphWrapper>(new ONNXGraphWrapper(net)), subgraphs);
}
+5
View File
@@ -698,6 +698,11 @@ TEST_P(Test_ONNX_layers, ResizeOpset11_Torch1_6)
testONNXModels("resize_opset11_torch1.6");
}
TEST_P(Test_ONNX_layers, Mish)
{
testONNXModels("mish");
}
TEST_P(Test_ONNX_layers, Conv1d)
{
testONNXModels("conv1d");