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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user