class_docstr: Object representing a segmentation map associated with an image.
  
  Attributes
  ----------
  DEFAULT_SEGMENT_COLORS : list of tuple of int
      Standard RGB colors to use during drawing, ordered by class index.
  
  Parameters
  ----------
  arr : (H,W) ndarray or (H,W,C) ndarray
      Array representing the segmentation map(s). May have dtypes bool,
      int or uint.
  
  shape : tuple of int
      Shape of the image on which the segmentation map(s) is/are placed.
      **Not** the shape of the segmentation map(s) array, unless it is
      identical to the image shape (note the likely difference between the
      arrays in the number of channels).
      This is expected to be ``(H, W)`` or ``(H, W, C)`` with ``C`` usually
      being ``3``.
      If there is no corresponding image, use ``(H_arr, W_arr)`` instead,
      where ``H_arr`` is the height of the segmentation map(s) array
      (analogous ``W_arr``).
  
  nb_classes : None or int, optional
      Deprecated.
class_docstr_tok: ["Object","representing","a","segmentation","map","associated","with","an","image",".","Attributes","--","--","--","--","--","DEFAULT_SEGMENT_COLORS",":","list","of","tuple","of","int","Standard","RGB","colors","to","use","during","drawing",",","ordered","by","class","index",".","Parameters","--","--","--","--","--","arr",":","(","H",",","W",")","ndarray","or","(","H",",","W",",","C",")","ndarray","Array","representing","the","segmentation","map","(","s",")",".","May","have","dtypes","bool",",","int","or","uint",".","shape",":","tuple","of","int","Shape","of","the","image","on","which","the","segmentation","map","(","s",")","is\/are","placed",".","*","*","Not","*","*","the","shape","of","the","segmentation","map","(","s",")","array",",","unless","it","is","identical","to","the","image","shape","(","note","the","likely","difference","between","the","arrays","in","the","number","of","channels",")",".","This","is","expected","to","be","``","(","H",",","W",")","``","or","``","(","H",",","W",",","C",")","``","with","``","C","``","usually","being","``","3","``",".","If","there","is","no","corresponding","image",",","use","``","(","H_arr",",","W_arr",")","``","instead",",","where","``","H_arr","``","is","the","height","of","the","segmentation","map","(","s",")","array","(","analogous","``","W_arr","``",")",".","nb_classes",":","None","or","int",",","optional","Deprecated","."]
code: def __init__(self, arr, shape, nb_classes=None):
      assert ia.is_np_array(
          arr
      ), "Expected to get numpy array, got %s." % (type(arr),)
      assert arr.ndim in [2, 3], (
          "Expected segmentation map array to be 2- or "
          "3-dimensional, got %d dimensions and shape %s."
          % (arr.ndim, arr.shape)
      )
      assert isinstance(shape, tuple), (
          "Expected 'shape' to be a tuple denoting the shape of the image "
          "on which the segmentation map is placed. Got type %s instead."
          % (type(shape))
      )
  
      if arr.dtype.kind == "f":
          ia.warn_deprecated(
              "Got a float array as the segmentation map in "
              "SegmentationMapsOnImage. That is deprecated. Please provide "
              "instead a (H,W,[C]) array of dtype bool_, int or uint, where "
              "C denotes the segmentation map index."
          )
  
          if arr.ndim == 2:
              arr = arr > 0.5
          else:  # arr.ndim == 3
              arr = np.argmax(arr, axis=2).astype(np.int32)
  
      if arr.dtype.name == "bool":
          self._input_was = (arr.dtype, arr.ndim)
          if arr.ndim == 2:
              arr = arr[..., np.newaxis]
      elif arr.dtype.kind in ["i", "u"]:
          assert np.min(arr.flat[0:100]) >= 0, (
              "Expected segmentation map array to only contain values >=0, "
              "got a minimum of %d." % (np.min(arr),)
          )
          if arr.dtype.kind == "u":
              # allow only <=uint16 due to conversion to int32
              assert arr.dtype.itemsize <= 2, (
                  "When using uint arrays as segmentation maps, only uint8 "
                  "and uint16 are allowed. Got dtype %s."
                  % (arr.dtype.name,)
              )
          elif arr.dtype.kind == "i":
              # allow only <=uint16 due to conversion to int32
              assert arr.dtype.itemsize <= 4, (
                  "When using int arrays as segmentation maps, only int8, "
                  "int16 and int32 are allowed. Got dtype %s."
                  % (arr.dtype.name,)
              )
  
          self._input_was = (arr.dtype, arr.ndim)
          if arr.ndim == 2:
              arr = arr[..., np.newaxis]
      else:
          raise Exception(
              (
                  "Input was expected to be an array of dtype 'bool', 'int' "
                  "or 'uint'. Got dtype '%s'."
              )
              % (arr.dtype.name,)
          )
  
      if arr.dtype.name != "int32":
          arr = arr.astype(np.int32)
  
      self.arr = arr
      self.shape = shape
  
      if nb_classes is not None:
          ia.warn_deprecated(
              "Providing nb_classes to SegmentationMapsOnImage is no longer "
              "necessary and hence deprecated. The argument is ignored "
              "and can be safely removed."
          )
  
imports: from __future__ import print_function, division, absolute_import
  import numpy
  import six.moves
  from ..None import imgaug
  from ..augmenters import blend
  from .base import IAugmentable
label_desc: Use image node_id 1 to create a new SegmentationMapsOnImage object from inherited base classes: IAugmentable with example: obj = SegmentationMapsOnImage(arr, shape, nb_classes)