def testScaleBoxesToPixelCoordinatesWithKeypoints(self):
    """Tests box and keypoint scaling, checking scaled values."""
    def graph_fn():
      in_shape = [60, 40, 3]
      in_boxes = self.createTestBoxes()
      in_keypoints, _ = self.createTestKeypoints()
      in_image = tf.random_uniform(in_shape)
      (_, out_boxes,
       out_keypoints) = preprocessor.scale_boxes_to_pixel_coordinates(
           in_image, boxes=in_boxes, keypoints=in_keypoints)
      return out_boxes, out_keypoints
    expected_boxes = [[0., 10., 45., 40.],
                      [15., 20., 45., 40.]]
    expected_keypoints = [
        [[6., 4.], [12., 8.], [18., 12.]],
        [[24., 16.], [30., 20.], [36., 24.]],
    ]
    out_boxes_, out_keypoints_ = self.execute_cpu(graph_fn, [])
    self.assertAllClose(out_boxes_, expected_boxes)
    self.assertAllClose(out_keypoints_, expected_keypoints)
Tests box and keypoint scaling, checking scaled values.
inference_api/src/main/object_detection/core/preprocessor_test.py