def testRotatedIOURotated30(self): with self.cached_session(): with ops.device("/cpu:0"): self.assertAllClose( rotated_iou_ops.rotated_iou([[0., 0., 2., 3., 0.]], [[0., 0., 2., 3., 30.]]), np.array([[0.69422]]))
def testRotatedIOUWithRotation(self): with self.cached_session(): with ops.device("/cpu:0"): self.assertAllClose( rotated_iou_ops.rotated_iou([[0., 0., 2., 6., 0.]], [[0., 0., 2., 6., 90.]]), np.array([[0.2]]))
def testRotatedIOUOneThirdIntersection(self): with self.cached_session(): with ops.device("/cpu:0"): self.assertAllClose( rotated_iou_ops.rotated_iou([[0., 0., 2., 3., 0.]], [[1., 0., 2., 3., 0.]]), np.array([[0.333333]]))
def testRotatedIOURowColumns(self): with self.cached_session(): with ops.device("/gpu:0"): self.assertAllClose( rotated_iou_ops.rotated_iou([[0., 0., 2., 3., 0.], [100., 100., 2., 3., 0.], [0., 0., 2., 3., 0.]], [[100., 100., 2., 3., 0.], [0., 0., 2., 3., 0.], [0., 0., 2., 3., 0.], ]), np.array([[0.0, 1.0, 1.0], [1.0, 0.0, 0.0], [0.0, 1.0, 1.0]]) )
def testRotatedIOUMultiIntersection(self): with self.cached_session(): with ops.device("/gpu:0"): self.assertAllClose( rotated_iou_ops.rotated_iou([[0., 0., 2., 3., 0.], [0., 0., 2., 3., 0.], [0., 0., 2., 3., 0.]], [[0., 0., 2., 3., 0.], [100., 100., 2., 3., 0.], [1., 0., 2., 3., 0.], ]), np.array([[1.0, 0.0, 0.333333], [1.0, 0.0, 0.333333], [1.0, 0.0, 0.333333]]) )
def testRotatedIOURotated1(self): with self.cached_session(): with ops.device("/gpu:0"): self.assertAllClose( rotated_iou_ops.rotated_iou([[0., 0., 2., 3., 0.]], [[0., 0., 2., 3., 1.]]), np.array([[0.981565]]))