def transform_keypoints_to_image(keypoints, img):
  """Transform keypoints from range [0, 1] to image coordinates."""

  keypoints[:, :, 0] *= img.shape[0]
  keypoints[:, :, 1] *= img.shape[
      0]  # The saved keypoints are scaled by image height.

  return keypoints