Merge pull request #11835 from dkurt:dnn_tf_two_inputs
[platform/upstream/opencv.git] / modules / dnn / test / test_tf_importer.cpp
index 33238c7..747fefd 100644 (file)
@@ -441,4 +441,20 @@ TEST(Test_TensorFlow, resize_bilinear)
     runTensorFlowNet("resize_bilinear_factor");
 }
 
+TEST(Test_TensorFlow, two_inputs)
+{
+    Net net = readNet(path("two_inputs_net.pbtxt"));
+    net.setPreferableBackend(DNN_BACKEND_OPENCV);
+
+    Mat firstInput(2, 3, CV_32FC1), secondInput(2, 3, CV_32FC1);
+    randu(firstInput, -1, 1);
+    randu(secondInput, -1, 1);
+
+    net.setInput(firstInput, "first_input");
+    net.setInput(secondInput, "second_input");
+    Mat out = net.forward();
+
+    normAssert(out, firstInput + secondInput);
+}
+
 }