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

Merge pull request #15811 from l-bat:eltwise_div

Supported ONNX Squeeze, ReduceL2 and Eltwise::DIV

* Support eltwise div

* Fix test

* OpenCL support added

* refactoring

* fix code style

* Only squeeze with axes supported
This commit is contained in:
Lubov Batanina
2019-11-09 14:11:09 +03:00
committed by Alexander Alekhin
parent af23375352
commit cfc781949d
3 changed files with 97 additions and 9 deletions
+32
View File
@@ -318,6 +318,28 @@ TEST_P(Test_ONNX_layers, MultyInputs)
expectNoFallbacksFromIE(net);
}
TEST_P(Test_ONNX_layers, Div)
{
const String model = _tf("models/div.onnx");
Net net = readNetFromONNX(model);
ASSERT_FALSE(net.empty());
net.setPreferableBackend(backend);
net.setPreferableTarget(target);
Mat inp1 = blobFromNPY(_tf("data/input_div_0.npy"));
Mat inp2 = blobFromNPY(_tf("data/input_div_1.npy"));
Mat ref = blobFromNPY(_tf("data/output_div.npy"));
checkBackend(&inp1, &ref);
net.setInput(inp1, "0");
net.setInput(inp2, "1");
Mat out = net.forward();
normAssert(ref, out, "", default_l1, default_lInf);
expectNoFallbacksFromIE(net);
}
TEST_P(Test_ONNX_layers, DynamicReshape)
{
if (backend == DNN_BACKEND_INFERENCE_ENGINE)
@@ -333,6 +355,16 @@ TEST_P(Test_ONNX_layers, Reshape)
testONNXModels("unsqueeze");
}
TEST_P(Test_ONNX_layers, Squeeze)
{
testONNXModels("squeeze");
}
TEST_P(Test_ONNX_layers, ReduceL2)
{
testONNXModels("reduceL2");
}
TEST_P(Test_ONNX_layers, Slice)
{
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2019010000)