'Tests box and keypoint scaling, checking scaled values.'

def testScaleBoxesToPixelCoordinatesWithKeypoints(self):

    in_shape = [60, 40, 3]
    in_boxes = self.createTestBoxes()
    in_keypoints = self.createTestKeypoints()
    expected_boxes = [[0.0, 10.0, 45.0, 40.0], [15.0, 20.0, 45.0, 40.0]]
    expected_keypoints = [[[6.0, 4.0], [12.0, 8.0], [18.0, 12.0]], [[24.0, 16.0], [30.0, 20.0], [36.0, 24.0]]]
    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)
    with self.test_session() as sess:
        (out_boxes_, out_keypoints_) = sess.run([out_boxes, out_keypoints])
        self.assertAllClose(out_boxes_, expected_boxes)
        self.assertAllClose(out_keypoints_, expected_keypoints)
