def test_get_center_points(self): # Shape = [2, 1, 3, 2]. points = [[[[0.0, 1.0], [2.0, 3.0], [4.0, 5.0]]], [[[10.0, 11.0], [12.0, 13.0], [14.0, 15.0]]]] indices = [0, 1] # Shape = [2, 1, 1, 2]. points = keypoint_utils.get_points(points, indices) self.assertAllClose(points, [[[[1.0, 2.0]]], [[[11.0, 12.0]]]])
def test_get_single_points(self): # Shape = [2, 1, 3, 2]. points = [[[[0.0, 1.0], [2.0, 3.0], [4.0, 5.0]]], [[[10.0, 11.0], [12.0, 13.0], [14.0, 15.0]]]] indices = [1] # Shape = [2, 1, 1, 2]. points = keypoint_utils.get_points(points, indices) self.assertAllEqual(points, [[[[2.0, 3.0]]], [[[12.0, 13.0]]]])