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

Load networks from intermediate representation of Intel's Deep learning deployment toolkit.

This commit is contained in:
Dmitry Kurtaev
2018-03-16 19:27:04 +03:00
parent e06d1e8083
commit 7972f47ed4
7 changed files with 301 additions and 145 deletions
+21
View File
@@ -865,4 +865,25 @@ TEST(Layer_PriorBox, squares)
normAssert(out.reshape(1, 4), target);
}
#ifdef HAVE_INF_ENGINE
// Using Intel's Model Optimizer generate .xml and .bin files:
// ./ModelOptimizer -w /path/to/caffemodel -d /path/to/prototxt \
// -p FP32 -i -b ${batch_size} -o /path/to/output/folder
TEST(Layer_Test_Convolution_DLDT, Accuracy)
{
Net netDefault = readNet(_tf("layer_convolution.caffemodel"), _tf("layer_convolution.prototxt"));
Net net = readNet(_tf("layer_convolution.xml"), _tf("layer_convolution.bin"));
Mat inp = blobFromNPY(_tf("blob.npy"));
netDefault.setInput(inp);
Mat outDefault = netDefault.forward();
net.setInput(inp);
Mat out = net.forward();
normAssert(outDefault, out);
}
#endif // HAVE_INF_ENGINE
}} // namespace