code: def compute_geometric_median(points=None, eps=1e-5, X=None):
      """Estimate the geometric median of points in 2D.
  
      Code from https://stackoverflow.com/a/30305181
  
      Parameters
      ----------
      points : (N,2) ndarray
          Points in 2D. Second axis must be given in xy-form.
  
      eps : float, optional
          Distance threshold when to return the median.
  
      X : None or (N,2) ndarray, optional
          Deprecated.
  
      Returns
      -------
      (2,) ndarray
          Geometric median as xy-coordinate.
  
      """
      # pylint: disable=invalid-name
      if X is not None:
          assert points is None
          ia.warn_deprecated(
              "Using 'X' is deprecated, use 'points' instead."
          )
          points = X
  
      y = np.mean(points, 0)
  
      while True:
          dist = scipy.spatial.distance.cdist(points, [y])
          nonzeros = (dist != 0)[:, 0]
  
          dist_inv = 1 / dist[nonzeros]
          dist_inv_sum = np.sum(dist_inv)
          dist_inv_norm = dist_inv / dist_inv_sum
          T = np.sum(dist_inv_norm * points[nonzeros], 0)
  
          num_zeros = len(points) - np.sum(nonzeros)
          if num_zeros == 0:
              y1 = T
          elif num_zeros == len(points):
              return y
          else:
              R = (T - y) * dist_inv_sum
              r = np.linalg.norm(R)
              rinv = 0 if r == 0 else num_zeros / r
              y1 = max(0, 1 - rinv) * T + min(1, rinv) * y
  
          if scipy.spatial.distance.euclidean(y, y1) < eps:
              return y1
  
          y = y1
  
imports: from __future__ import print_function, division, absolute_import
  import numpy
  import scipy.spatial.distance
  import six.moves
  from ..None import imgaug
  from .base import IAugmentable
  from .utils import normalize_imglike_shape, project_coords, _remove_out_of_image_fraction_, _handle_on_image_shape
label_desc: Use image node_id 1 for calling a global function with example usage: compute_geometric_median(points, eps, X) and returns: y1, y