class_docstr: Container for all keypoints on a single image.
  
  Parameters
  ----------
  keypoints : list of imgaug.augmentables.kps.Keypoint
      List of keypoints on the image.
  
  shape : tuple of int
      The shape of the image on which the objects are placed, i.e. the
      result of ``image.shape``.
      Should include the number of channels, not only height and width.
  
  Examples
  --------
  >>> import numpy as np
  >>> from imgaug.augmentables.kps import Keypoint, KeypointsOnImage
  >>>
  >>> image = np.zeros((70, 70))
  >>> kps = [Keypoint(x=10, y=20), Keypoint(x=34, y=60)]
  >>> kps_oi = KeypointsOnImage(kps, shape=image.shape)
class_docstr_tok: ["Container","for","all","keypoints","on","a","single","image",".","Parameters","--","--","--","--","--","keypoints",":","list","of","imgaug.augmentables.kps.Keypoint","List","of","keypoints","on","the","image",".","shape",":","tuple","of","int","The","shape","of","the","image","on","which","the","objects","are","placed",",","i.e",".","the","result","of","``","image.shape","``",".","Should","include","the","number","of","channels",",","not","only","height","and","width",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","imgaug.augmentables.kps","import","Keypoint",",","KeypointsOnImage",">",">",">",">",">",">","image","=","np.zeros","(","(","70",",","70",")",")",">",">",">","kps","=","[","Keypoint","(","x=10",",","y=20",")",",","Keypoint","(","x=34",",","y=60",")","]",">",">",">","kps_oi","=","KeypointsOnImage","(","kps",",","shape=image.shape",")"]
docstr: Convert an ``(N,2)`` array to a ``KeypointsOnImage`` object.
  
  Parameters
  ----------
  xy : (N, 2) ndarray or iterable of iterable of number
      Coordinates of ``N`` keypoints on an image, given as a ``(N,2)``
      array of xy-coordinates.
  
  shape : tuple of int or ndarray
      The shape of the image on which the keypoints are placed.
  
  Returns
  -------
  imgaug.augmentables.kps.KeypointsOnImage
      :class:`KeypointsOnImage` object containing the array's keypoints.
docstr_tok: ["Convert","an","``","(","N,2",")","``","array","to","a","``","KeypointsOnImage","``","object",".","Parameters","--","--","--","--","--","xy",":","(","N",",","2",")","ndarray","or","iterable","of","iterable","of","number","Coordinates","of","``","N","``","keypoints","on","an","image",",","given","as","a","``","(","N,2",")","``","array","of","xy-coordinates",".","shape",":","tuple","of","int","or","ndarray","The","shape","of","the","image","on","which","the","keypoints","are","placed",".","Returns","--","--","--","-","imgaug.augmentables.kps.KeypointsOnImage",":","class",":","`","KeypointsOnImage","`","object","containing","the","array","'s","keypoints","."]
code: def from_xy_array(cls, xy, shape):
      """Convert an ``(N,2)`` array to a ``KeypointsOnImage`` object.
  
      Parameters
      ----------
      xy : (N, 2) ndarray or iterable of iterable of number
          Coordinates of ``N`` keypoints on an image, given as a ``(N,2)``
          array of xy-coordinates.
  
      shape : tuple of int or ndarray
          The shape of the image on which the keypoints are placed.
  
      Returns
      -------
      imgaug.augmentables.kps.KeypointsOnImage
          :class:`KeypointsOnImage` object containing the array's keypoints.
  
      """
      xy = np.array(xy, dtype=np.float32)
  
      # note that np.array([]) is (0,), not (0, 2)
      if xy.shape[0] == 0:  # pylint: disable=unsubscriptable-object
          return KeypointsOnImage([], shape)
  
      assert (
          xy.ndim == 2 and xy.shape[-1] == 2
      ), (  # pylint: disable=unsubscriptable-object
          "Expected input array to have shape (N,2), "
          "got shape %s." % (xy.shape,)
      )
      keypoints = [Keypoint(x=coord[0], y=coord[1]) for coord in xy]
      return KeypointsOnImage(keypoints, shape)
  
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 19 for calling the KeypointsOnImage obj's underlying member method code with example usage: obj.from_xy_array(cls, xy, shape) and returns: KeypointsOnImage, KeypointsOnImage