Fix ONNX's emotion_ferplus model.

Reduce input size for OpenPose tests
pull/13263/head
Dmitry Kurtaev 6 years ago
parent dc80f9d0fb
commit 2f6f52d644
  1. 23
      modules/dnn/src/onnx/onnx_importer.cpp
  2. 6
      modules/dnn/test/test_backends.cpp

@ -358,7 +358,8 @@ void ONNXImporter::populateNet(Net dstNet)
layerParams.set("shift", blob.at<float>(0));
}
else {
layerParams.type = "Shift";
layerParams.type = "Scale";
layerParams.set("bias_term", true);
layerParams.blobs.push_back(blob);
}
}
@ -375,8 +376,26 @@ void ONNXImporter::populateNet(Net dstNet)
layerParams.set("shift", blob.at<float>(0));
}
else {
layerParams.type = "Shift";
layerParams.type = "Scale";
layerParams.set("has_bias", true);
layerParams.blobs.push_back(blob);
}
}
else if (layer_type == "Div")
{
Mat blob = getBlob(node_proto, constBlobs, 1);
CV_Assert_N(blob.type() == CV_32F, blob.total());
divide(1.0, blob, blob);
if (blob.total() == 1)
{
layerParams.set("scale", blob.at<float>(0));
layerParams.type = "Power";
}
else
{
layerParams.type = "Scale";
layerParams.blobs.push_back(blob);
layerParams.set("bias_term", false);
}
}
else if (layer_type == "Constant")

@ -197,7 +197,7 @@ TEST_P(DNNTestNetwork, OpenPose_pose_coco)
(backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD))
throw SkipTestException("");
processNet("dnn/openpose_pose_coco.caffemodel", "dnn/openpose_pose_coco.prototxt",
Size(368, 368));
Size(46, 46));
}
TEST_P(DNNTestNetwork, OpenPose_pose_mpi)
@ -206,7 +206,7 @@ TEST_P(DNNTestNetwork, OpenPose_pose_mpi)
(backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD))
throw SkipTestException("");
processNet("dnn/openpose_pose_mpi.caffemodel", "dnn/openpose_pose_mpi.prototxt",
Size(368, 368));
Size(46, 46));
}
TEST_P(DNNTestNetwork, OpenPose_pose_mpi_faster_4_stages)
@ -217,7 +217,7 @@ TEST_P(DNNTestNetwork, OpenPose_pose_mpi_faster_4_stages)
// The same .caffemodel but modified .prototxt
// See https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/src/openpose/pose/poseParameters.cpp
processNet("dnn/openpose_pose_mpi.caffemodel", "dnn/openpose_pose_mpi_faster_4_stages.prototxt",
Size(368, 368));
Size(46, 46));
}
TEST_P(DNNTestNetwork, OpenFace)

Loading…
Cancel
Save