diff --git a/testdata/dnn/tensorflow/generate_tf_models.py b/testdata/dnn/tensorflow/generate_tf_models.py index bbc4de449..20c2cb070 100644 --- a/testdata/dnn/tensorflow/generate_tf_models.py +++ b/testdata/dnn/tensorflow/generate_tf_models.py @@ -703,6 +703,27 @@ def pad_depth(x, desired_channels): f.write(graph_def.SerializeToString()) ################################################################################ +# issue https://github.com/opencv/opencv/issues/13839 +inp_node = 'PNet/conv3/add' +out_node = 'PNet/cls_prob' +with tf.Session(graph=tf.Graph()) as localSession: + localSession.graph.as_default() + + with tf.gfile.FastGFile('PNet_pnet.pb') as f: + graph_def = tf.GraphDef() + graph_def.ParseFromString(f.read()) + graph_def = TransformGraph(graph_def, [inp_node], [out_node], ['strip_unused_nodes']) + + tf.import_graph_def(graph_def, name='') + + inputData = gen_data(tf.placeholder(tf.float32, [1, 4, 5, 16], inp_node)) + outputData = localSession.run(localSession.graph.get_tensor_by_name(out_node + ':0'), + feed_dict={inp_node + ':0': inputData}) + writeBlob(inputData, 'slim_softmax_v2_in') + writeBlob(outputData, 'slim_softmax_v2_out') + + with tf.gfile.FastGFile('slim_softmax_v2_net.pb', 'wb') as f: + f.write(graph_def.SerializeToString()) # Uncomment to print the final graph. # with tf.gfile.FastGFile('fused_batch_norm_net.pb') as f: diff --git a/testdata/dnn/tensorflow/slim_softmax_v2_in.npy b/testdata/dnn/tensorflow/slim_softmax_v2_in.npy new file mode 100644 index 000000000..574f8c590 Binary files /dev/null and b/testdata/dnn/tensorflow/slim_softmax_v2_in.npy differ diff --git a/testdata/dnn/tensorflow/slim_softmax_v2_net.pb b/testdata/dnn/tensorflow/slim_softmax_v2_net.pb new file mode 100644 index 000000000..97418cc1b Binary files /dev/null and b/testdata/dnn/tensorflow/slim_softmax_v2_net.pb differ diff --git a/testdata/dnn/tensorflow/slim_softmax_v2_out.npy b/testdata/dnn/tensorflow/slim_softmax_v2_out.npy new file mode 100644 index 000000000..3c1a3b5fd Binary files /dev/null and b/testdata/dnn/tensorflow/slim_softmax_v2_out.npy differ diff --git a/testdata/ml/opencv_ml_knn.xml b/testdata/ml/opencv_ml_knn.xml new file mode 100644 index 000000000..96aea6f5e --- /dev/null +++ b/testdata/ml/opencv_ml_knn.xml @@ -0,0 +1,19 @@ + + + + 3 + 1 + 10 + + 3 + 2 +
f
+ + 1. 1. 3. 3. 10. 5.
+ + 3 + 1 +
f
+ + 0. 1. 2.
+