def find_connected_components(image: np.ndarray) -> Tuple[int, List[Tuple[float, float]]]:
    """
    Find connected components in a binary image.

    Args:
    - image (np.ndarray): The input binary image. 1 channel.

    Returns:
    - Tuple[int, List[Tuple[float, float]]]: A tuple containing the maximum label value and a list of
      centroids of connected components. The centroid is represented as a tuple of (x, y) coordinates.
    """
    _, labels, stats, centroids = cv2.connectedComponentsWithStats(image)

    stats = stats[1:]
    centroids = centroids[1:]

    return labels.max(), [(float(x), float(y)) for x, y in centroids]

    Find connected components in a binary image.

    Args:
    - image (np.ndarray): The input binary image. 1 channel.

    Returns:
    - Tuple[int, List[Tuple[float, float]]]: A tuple containing the maximum label value and a list of
      centroids of connected components. The centroid is represented as a tuple of (x, y) coordinates.
    
scripts/easyphoto_utils/tryon_utils.py