def graph_fn(): keypoints = tf.constant([[[0.1, 0.1], [0.2, 0.2], [0.3, 0.3]], [[0.4, 0.6], [0.5, 0.6], [0.6, 0.7]]]) expected_keypoints = tf.constant([ [[0.9, 0.1], [0.8, 0.2], [0.7, 0.3]], [[0.4, 0.4], [0.4, 0.5], [0.3, 0.6]], ]) output = keypoint_ops.rot90(keypoints) return output, expected_keypoints
def graph_fn(): keypoints = tf.constant([[[0.1, 0.1], [0.2, 0.2], [0.3, 0.3]], [[0.4, 0.6], [0.5, 0.6], [0.6, 0.7]]]) rot_permutation = [0, 2, 1] expected_keypoints = tf.constant([ [[0.9, 0.1], [0.7, 0.3], [0.8, 0.2]], [[0.4, 0.4], [0.3, 0.6], [0.4, 0.5]], ]) output = keypoint_ops.rot90(keypoints, rotation_permutation=rot_permutation) return output, expected_keypoints
def test_rot90(self): keypoints = tf.constant([[[0.1, 0.1], [0.2, 0.2], [0.3, 0.3]], [[0.4, 0.6], [0.5, 0.6], [0.6, 0.7]]]) expected_keypoints = tf.constant([ [[0.9, 0.1], [0.8, 0.2], [0.7, 0.3]], [[0.4, 0.4], [0.4, 0.5], [0.3, 0.6]], ]) output = keypoint_ops.rot90(keypoints) with self.test_session() as sess: output_, expected_keypoints_ = sess.run( [output, expected_keypoints]) self.assertAllClose(output_, expected_keypoints_)
def test_rot90(self): keypoints = tf.constant([ [[0.1, 0.1], [0.2, 0.2], [0.3, 0.3]], [[0.4, 0.6], [0.5, 0.6], [0.6, 0.7]] ]) expected_keypoints = tf.constant([ [[0.9, 0.1], [0.8, 0.2], [0.7, 0.3]], [[0.4, 0.4], [0.4, 0.5], [0.3, 0.6]], ]) output = keypoint_ops.rot90(keypoints) with self.test_session() as sess: output_, expected_keypoints_ = sess.run([output, expected_keypoints]) self.assertAllClose(output_, expected_keypoints_)