Merge pull request #12275 from alalek:fix_build_dnn_inf_engine

This commit is contained in:
Alexander Alekhin 2018-08-22 14:38:05 +00:00
commit 6700fdb81f
2 changed files with 8 additions and 7 deletions

View File

@ -588,7 +588,8 @@ struct DataLayer : public Layer
lp.precision = InferenceEngine::Precision::FP32;
std::shared_ptr<InferenceEngine::ScaleShiftLayer> ieLayer(new InferenceEngine::ScaleShiftLayer(lp));
CV_Assert(inputsData.size() == 1, inputsData[0].dims == 4);
CV_CheckEQ(inputsData.size(), (size_t)1, "");
CV_CheckEQ(inputsData[0].dims, 4, "");
const size_t numChannels = inputsData[0].size[1];
CV_Assert(numChannels <= 4);
@ -1302,7 +1303,7 @@ struct Net::Impl
if (!node.empty())
{
Ptr<InfEngineBackendNode> ieNode = node.dynamicCast<InfEngineBackendNode>();
CV_Assert(!ieNode.empty(), !ieNode->net.empty());
CV_Assert(!ieNode.empty()); CV_Assert(!ieNode->net.empty());
layerNet = ieNode->net;
}
}
@ -1316,7 +1317,7 @@ struct Net::Impl
if (!inpNode.empty())
{
Ptr<InfEngineBackendNode> ieInpNode = inpNode.dynamicCast<InfEngineBackendNode>();
CV_Assert(!ieInpNode.empty(), !ieInpNode->net.empty());
CV_Assert(!ieInpNode.empty()); CV_Assert(!ieInpNode->net.empty());
if (layerNet != ieInpNode->net)
{
// layerNet is empty or nodes are from different graphs.
@ -1425,7 +1426,7 @@ struct Net::Impl
if (!inpNode.empty())
{
Ptr<InfEngineBackendNode> ieInpNode = inpNode.dynamicCast<InfEngineBackendNode>();
CV_Assert(!ieInpNode.empty(), !ieInpNode->net.empty());
CV_Assert(!ieInpNode.empty()); CV_Assert(!ieInpNode->net.empty());
if (ieInpNode->net != net)
{
net = Ptr<InfEngineBackendNet>();

View File

@ -487,8 +487,8 @@ public:
if (_explicitSizes)
{
CV_Assert(!_boxWidths.empty(), !_boxHeights.empty(),
_boxWidths.size() == _boxHeights.size());
CV_Assert(!_boxWidths.empty()); CV_Assert(!_boxHeights.empty());
CV_Assert(_boxWidths.size() == _boxHeights.size());
ieLayer->params["width"] = format("%f", _boxWidths[0]);
ieLayer->params["height"] = format("%f", _boxHeights[0]);
for (int i = 1; i < _boxWidths.size(); ++i)
@ -530,7 +530,7 @@ public:
ieLayer->params["step_h"] = format("%f", _stepY);
ieLayer->params["step_w"] = format("%f", _stepX);
}
CV_Assert(_offsetsX.size() == 1, _offsetsY.size() == 1, _offsetsX[0] == _offsetsY[0]);
CV_CheckEQ(_offsetsX.size(), (size_t)1, ""); CV_CheckEQ(_offsetsY.size(), (size_t)1, ""); CV_CheckEQ(_offsetsX[0], _offsetsY[0], "");
ieLayer->params["offset"] = format("%f", _offsetsX[0]);
return Ptr<BackendNode>(new InfEngineBackendNode(ieLayer));