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

Backport for dnn input shape estimation

This commit is contained in:
Dmitry Kurtaev
2019-12-02 16:25:21 +03:00
parent 7523c777c5
commit ca1ba7a53d
4 changed files with 63 additions and 15 deletions
+11
View File
@@ -182,6 +182,17 @@ TEST_P(Reproducibility_AlexNet, Accuracy)
ASSERT_FALSE(net.empty());
}
// Test input layer size
std::vector<MatShape> inLayerShapes;
std::vector<MatShape> outLayerShapes;
net.getLayerShapes(MatShape(), 0, inLayerShapes, outLayerShapes);
ASSERT_FALSE(inLayerShapes.empty());
ASSERT_EQ(inLayerShapes[0].size(), 4);
ASSERT_EQ(inLayerShapes[0][0], 1);
ASSERT_EQ(inLayerShapes[0][1], 3);
ASSERT_EQ(inLayerShapes[0][2], 227);
ASSERT_EQ(inLayerShapes[0][3], 227);
const float l1 = 1e-5;
const float lInf = (targetId == DNN_TARGET_OPENCL_FP16) ? 3e-3 : 1e-4;