Python object_detection.core.box_list_ops.sq_dist() Examples

The following are 30 code examples of object_detection.core.box_list_ops.sq_dist(). 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.box_list_ops , or try the search function .
Example #1
Source File: region_similarity_calculator.py    From AniSeg with Apache License 2.0 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #2
Source File: region_similarity_calculator.py    From hands-detection with MIT License 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #3
Source File: box_list_ops_test.py    From object_detection_kitti with Apache License 2.0 5 votes vote down vote up
def test_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #4
Source File: region_similarity_calculator.py    From object_detection_kitti with Apache License 2.0 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #5
Source File: box_list_ops_test.py    From MBMD with MIT License 5 votes vote down vote up
def test_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #6
Source File: region_similarity_calculator.py    From MBMD with MIT License 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #7
Source File: box_list_ops_test.py    From Elphas with Apache License 2.0 5 votes vote down vote up
def test_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #8
Source File: region_similarity_calculator.py    From Elphas with Apache License 2.0 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #9
Source File: box_list_ops_test.py    From object_detection_with_tensorflow with MIT License 5 votes vote down vote up
def test_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #10
Source File: region_similarity_calculator.py    From object_detection_with_tensorflow with MIT License 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #11
Source File: box_list_ops_test.py    From object_detection_with_tensorflow with MIT License 5 votes vote down vote up
def test_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #12
Source File: region_similarity_calculator.py    From object_detection_with_tensorflow with MIT License 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #13
Source File: box_list_ops_test.py    From monopsr with MIT License 5 votes vote down vote up
def test_pairwise_distances(self):
        corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                                [1.0, 1.0, 0.0, 2.0]])
        corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                                [-4.0, 0.0, 0.0, 3.0],
                                [0.0, 0.0, 0.0, 0.0]])
        exp_output = [[26, 25, 0], [18, 27, 6]]
        boxes1 = box_list.BoxList(corners1)
        boxes2 = box_list.BoxList(corners2)
        dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
        with self.test_session() as sess:
            dist_output = sess.run(dist_matrix)
            self.assertAllClose(dist_output, exp_output) 
Example #14
Source File: region_similarity_calculator.py    From monopsr with MIT License 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
        """Compute matrix of (negated) sq distances.

        Args:
          boxlist1: BoxList holding N boxes.
          boxlist2: BoxList holding M boxes.

        Returns:
          A tensor with shape [N, M] representing negated pairwise squared distance.
        """
        return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #15
Source File: box_list_ops_test.py    From AniSeg with Apache License 2.0 5 votes vote down vote up
def test_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #16
Source File: box_list_ops_test.py    From hands-detection with MIT License 5 votes vote down vote up
def test_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #17
Source File: box_list_ops_test.py    From MAX-Object-Detector with Apache License 2.0 5 votes vote down vote up
def test_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #18
Source File: region_similarity_calculator.py    From MAX-Object-Detector with Apache License 2.0 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #19
Source File: box_list_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_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #20
Source File: region_similarity_calculator.py    From Accident-Detection-on-Indian-Roads with GNU Affero General Public License v3.0 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #21
Source File: box_list_ops_test.py    From g-tensorflow-models with Apache License 2.0 5 votes vote down vote up
def test_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #22
Source File: region_similarity_calculator.py    From g-tensorflow-models with Apache License 2.0 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #23
Source File: box_list_ops_test.py    From models with Apache License 2.0 5 votes vote down vote up
def test_pairwise_distances(self):
    def graph_fn():
      corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                              [1.0, 1.0, 0.0, 2.0]])
      corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                              [-4.0, 0.0, 0.0, 3.0],
                              [0.0, 0.0, 0.0, 0.0]])
      boxes1 = box_list.BoxList(corners1)
      boxes2 = box_list.BoxList(corners2)
      dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
      return dist_matrix
    exp_output = [[26, 25, 0], [18, 27, 6]]
    dist_output = self.execute(graph_fn, [])
    self.assertAllClose(dist_output, exp_output) 
Example #24
Source File: region_similarity_calculator.py    From models with Apache License 2.0 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #25
Source File: box_list_ops_test.py    From motion-rcnn with MIT License 5 votes vote down vote up
def test_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #26
Source File: region_similarity_calculator.py    From motion-rcnn with MIT License 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #27
Source File: box_list_ops_test.py    From mtl-ssl with Apache License 2.0 5 votes vote down vote up
def test_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #28
Source File: region_similarity_calculator.py    From mtl-ssl with Apache License 2.0 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2) 
Example #29
Source File: box_list_ops_test.py    From multilabel-image-classification-tensorflow with MIT License 5 votes vote down vote up
def test_pairwise_distances(self):
    corners1 = tf.constant([[0.0, 0.0, 0.0, 0.0],
                            [1.0, 1.0, 0.0, 2.0]])
    corners2 = tf.constant([[3.0, 4.0, 1.0, 0.0],
                            [-4.0, 0.0, 0.0, 3.0],
                            [0.0, 0.0, 0.0, 0.0]])
    exp_output = [[26, 25, 0], [18, 27, 6]]
    boxes1 = box_list.BoxList(corners1)
    boxes2 = box_list.BoxList(corners2)
    dist_matrix = box_list_ops.sq_dist(boxes1, boxes2)
    with self.test_session() as sess:
      dist_output = sess.run(dist_matrix)
      self.assertAllClose(dist_output, exp_output) 
Example #30
Source File: region_similarity_calculator.py    From multilabel-image-classification-tensorflow with MIT License 5 votes vote down vote up
def _compare(self, boxlist1, boxlist2):
    """Compute matrix of (negated) sq distances.

    Args:
      boxlist1: BoxList holding N boxes.
      boxlist2: BoxList holding M boxes.

    Returns:
      A tensor with shape [N, M] representing negated pairwise squared distance.
    """
    return -1 * box_list_ops.sq_dist(boxlist1, boxlist2)