Python object_detection.core.keypoint_ops.rot90() Examples

The following are 18 code examples of object_detection.core.keypoint_ops.rot90(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module object_detection.core.keypoint_ops , or try the search function .
Example #1
Source File: keypoint_ops_test.py    From models with Apache License 2.0 6 votes vote down vote up
def test_rot90_permutation(self):

    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

    output, expected_keypoints = self.execute(graph_fn, [])
    self.assertAllClose(output, expected_keypoints) 
Example #2
Source File: keypoint_ops_test.py    From object_detection_with_tensorflow with MIT License 5 votes vote down vote up
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_) 
Example #3
Source File: keypoint_ops_test.py    From multilabel-image-classification-tensorflow with MIT License 5 votes vote down vote up
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_) 
Example #4
Source File: keypoint_ops_test.py    From models with Apache License 2.0 5 votes vote down vote up
def test_rot90(self):
    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
    output, expected_keypoints = self.execute(graph_fn, [])
    self.assertAllClose(output, expected_keypoints) 
Example #5
Source File: keypoint_ops_test.py    From g-tensorflow-models with Apache License 2.0 5 votes vote down vote up
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_) 
Example #6
Source File: keypoint_ops_test.py    From Accident-Detection-on-Indian-Roads with GNU Affero General Public License v3.0 5 votes vote down vote up
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_) 
Example #7
Source File: keypoint_ops_test.py    From MAX-Object-Detector with Apache License 2.0 5 votes vote down vote up
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_) 
Example #8
Source File: keypoint_ops_test.py    From AniSeg with Apache License 2.0 5 votes vote down vote up
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_) 
Example #9
Source File: keypoint_ops_test.py    From object_detection_with_tensorflow with MIT License 5 votes vote down vote up
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_) 
Example #10
Source File: keypoint_ops_test.py    From vehicle_counting_tensorflow with MIT License 5 votes vote down vote up
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_) 
Example #11
Source File: keypoint_ops_test.py    From Elphas with Apache License 2.0 5 votes vote down vote up
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_) 
Example #12
Source File: keypoint_ops_test.py    From BMW-TensorFlow-Training-GUI with Apache License 2.0 5 votes vote down vote up
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_) 
Example #13
Source File: keypoint_ops_test.py    From ros_tensorflow with Apache License 2.0 5 votes vote down vote up
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_) 
Example #14
Source File: keypoint_ops_test.py    From Gun-Detector with Apache License 2.0 5 votes vote down vote up
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_) 
Example #15
Source File: keypoint_ops_test.py    From Traffic-Rule-Violation-Detection-System with MIT License 5 votes vote down vote up
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_) 
Example #16
Source File: keypoint_ops_test.py    From yolo_v2 with Apache License 2.0 5 votes vote down vote up
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_) 
Example #17
Source File: keypoint_ops_test.py    From Person-Detection-and-Tracking with MIT License 5 votes vote down vote up
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_) 
Example #18
Source File: keypoint_ops_test.py    From ros_people_object_detection_tensorflow with Apache License 2.0 5 votes vote down vote up
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_)