Ejemplo n.º 1
0
        def graph_fn():
            keypoints = tf.constant([[[0.1, 0.1], [0.2, 0.2], [0.3, 0.3]],
                                     [[0.4, 0.4], [0.5, 0.5], [0.6, 0.6]]])

            expected_keypoints = tf.constant([
                [[0.9, 0.1], [0.8, 0.2], [0.7, 0.3]],
                [[0.6, 0.4], [0.5, 0.5], [0.4, 0.6]],
            ])
            output = keypoint_ops.flip_vertical(keypoints, 0.5)
            return output, expected_keypoints
Ejemplo n.º 2
0
        def graph_fn():
            keypoints = tf.constant([[[0.1, 0.1], [0.2, 0.2], [0.3, 0.3]],
                                     [[0.4, 0.4], [0.5, 0.5], [0.6, 0.6]]])
            flip_permutation = [0, 2, 1]

            expected_keypoints = tf.constant([
                [[0.9, 0.1], [0.7, 0.3], [0.8, 0.2]],
                [[0.6, 0.4], [0.4, 0.6], [0.5, 0.5]],
            ])
            output = keypoint_ops.flip_vertical(keypoints, 0.5,
                                                flip_permutation)
            return output, expected_keypoints
Ejemplo n.º 3
0
    def test_flip_vertical(self):
        keypoints = tf.constant([[[0.1, 0.1], [0.2, 0.2], [0.3, 0.3]],
                                 [[0.4, 0.4], [0.5, 0.5], [0.6, 0.6]]])
        flip_permutation = [0, 2, 1]

        expected_keypoints = tf.constant([
            [[0.9, 0.1], [0.7, 0.3], [0.8, 0.2]],
            [[0.6, 0.4], [0.4, 0.6], [0.5, 0.5]],
        ])
        output = keypoint_ops.flip_vertical(keypoints, 0.5, flip_permutation)

        with self.test_session() as sess:
            output_, expected_keypoints_ = sess.run(
                [output, expected_keypoints])
            self.assertAllClose(output_, expected_keypoints_)
Ejemplo n.º 4
0
  def test_flip_vertical(self):
    keypoints = tf.constant([
        [[0.1, 0.1], [0.2, 0.2], [0.3, 0.3]],
        [[0.4, 0.4], [0.5, 0.5], [0.6, 0.6]]
    ])
    flip_permutation = [0, 2, 1]

    expected_keypoints = tf.constant([
        [[0.9, 0.1], [0.7, 0.3], [0.8, 0.2]],
        [[0.6, 0.4], [0.4, 0.6], [0.5, 0.5]],
    ])
    output = keypoint_ops.flip_vertical(keypoints, 0.5, flip_permutation)

    with self.test_session() as sess:
      output_, expected_keypoints_ = sess.run([output, expected_keypoints])
      self.assertAllClose(output_, expected_keypoints_)