def CalculateKeypointCenters(boxes):
    """Helper function to compute feature centers, from RF boxes.

    Args:
    boxes: [N, 4] float array.

    Returns:
    centers: [N, 2] float array.
    """
    return (boxes[:, (0, 1)] + boxes[:, (2, 3)])/2.0