class_docstr: Apply median pooling to images.
  
  This augmenter pools images with kernel sizes ``H x W`` by taking the
  median pixel value over windows. For e.g. ``2 x 2`` this halves the image
  size. Optionally, the augmenter will automatically re-upscale the image
  to the input size (by default this is activated).
  
  The median within each pixel window is always taken channelwise.
  
  .. note::
  
      During heatmap or segmentation map augmentation, the respective
      arrays are not changed, only the shapes of the underlying images
      are updated. This is because imgaug can handle maps/maks that are
      larger/smaller than their corresponding image.
  
  **Supported dtypes**:
  
  See :func:`~imgaug.imgaug.median_pool`.
  
  Attributes
  ----------
  kernel_size : int or tuple of int or list of int or imgaug.parameters.StochasticParameter or tuple of tuple of int or tuple of list of int or tuple of imgaug.parameters.StochasticParameter, optional
      The kernel size of the pooling operation.
  
      * If an int, then that value will be used for all images for both
        kernel height and width.
      * If a tuple ``(a, b)``, then a value from the discrete range
        ``[a..b]`` will be sampled per image.
      * If a list, then a random value will be sampled from that list per
        image and used for both kernel height and width.
      * If a StochasticParameter, then a value will be sampled per image
        from that parameter per image and used for both kernel height and
        width.
      * If a tuple of tuple of int given as ``((a, b), (c, d))``, then two
        values will be sampled independently from the discrete ranges
        ``[a..b]`` and ``[c..d]`` per image and used as the kernel height
        and width.
      * If a tuple of lists of int, then two values will be sampled
        independently per image, one from the first list and one from the
        second, and used as the kernel height and width.
      * If a tuple of StochasticParameter, then two values will be sampled
        indepdently per image, one from the first parameter and one from the
        second, and used as the kernel height and width.
  
  keep_size : bool, optional
      After pooling, the result image will usually have a different
      height/width compared to the original input image. If this
      parameter is set to True, then the pooled image will be resized
      to the input image's size, i.e. the augmenter's output shape is always
      identical to the input shape.
  
  seed : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
      See :func:`~imgaug.augmenters.meta.Augmenter.__init__`.
  
  name : None or str, optional
      See :func:`~imgaug.augmenters.meta.Augmenter.__init__`.
  
  random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
      Old name for parameter `seed`.
      Its usage will not yet cause a deprecation warning,
      but it is still recommended to use `seed` now.
      Outdated since 0.4.0.
  
  deterministic : bool, optional
      Deprecated since 0.4.0.
      See method ``to_deterministic()`` for an alternative and for
      details about what the "deterministic mode" actually does.
  
  Examples
  --------
  >>> import imgaug.augmenters as iaa
  >>> aug = iaa.MedianPooling(2)
  
  Create an augmenter that always pools with a kernel size of ``2 x 2``.
  
  >>> aug = iaa.MedianPooling(2, keep_size=False)
  
  Create an augmenter that always pools with a kernel size of ``2 x 2``
  and does *not* resize back to the input image size, i.e. the resulting
  images have half the resolution.
  
  >>> aug = iaa.MedianPooling([2, 8])
  
  Create an augmenter that always pools either with a kernel size
  of ``2 x 2`` or ``8 x 8``.
  
  >>> aug = iaa.MedianPooling((1, 7))
  
  Create an augmenter that always pools with a kernel size of
  ``1 x 1`` (does nothing) to ``7 x 7``. The kernel sizes are always
  symmetric.
  
  >>> aug = iaa.MedianPooling(((1, 7), (1, 7)))
  
  Create an augmenter that always pools with a kernel size of
  ``H x W`` where ``H`` and ``W`` are both sampled independently from the
  range ``[1..7]``. E.g. resulting kernel sizes could be ``3 x 7``
  or ``5 x 1``.
class_docstr_tok: ["Apply","median","pooling","to","images",".","This","augmenter","pools","images","with","kernel","sizes","``","H","x","W","``","by","taking","the","median","pixel","value","over","windows",".","For","e.g",".","``","2","x","2","``","this","halves","the","image","size",".","Optionally",",","the","augmenter","will","automatically","re-upscale","the","image","to","the","input","size","(","by","default","this","is","activated",")",".","The","median","within","each","pixel","window","is","always","taken","channelwise",".","..","note",":",":","During","heatmap","or","segmentation","map","augmentation",",","the","respective","arrays","are","not","changed",",","only","the","shapes","of","the","underlying","images","are","updated",".","This","is","because","imgaug","can","handle","maps\/maks","that","are","larger\/smaller","than","their","corresponding","image",".","*","*","Supported","dtypes","*","*",":","See",":","func",":","`","~imgaug.imgaug.median_pool","`",".","Attributes","--","--","--","--","--","kernel_size",":","int","or","tuple","of","int","or","list","of","int","or","imgaug.parameters.StochasticParameter","or","tuple","of","tuple","of","int","or","tuple","of","list","of","int","or","tuple","of","imgaug.parameters.StochasticParameter",",","optional","The","kernel","size","of","the","pooling","operation",".","*","If","an","int",",","then","that","value","will","be","used","for","all","images","for","both","kernel","height","and","width",".","*","If","a","tuple","``","(","a",",","b",")","``",",","then","a","value","from","the","discrete","range","``","[","a","..","b","]","``","will","be","sampled","per","image",".","*","If","a","list",",","then","a","random","value","will","be","sampled","from","that","list","per","image","and","used","for","both","kernel","height","and","width",".","*","If","a","StochasticParameter",",","then","a","value","will","be","sampled","per","image","from","that","parameter","per","image","and","used","for","both","kernel","height","and","width",".","*","If","a","tuple","of","tuple","of","int","given","as","``","(","(","a",",","b",")",",","(","c",",","d",")",")","``",",","then","two","values","will","be","sampled","independently","from","the","discrete","ranges","``","[","a","..","b","]","``","and","``","[","c","..","d","]","``","per","image","and","used","as","the","kernel","height","and","width",".","*","If","a","tuple","of","lists","of","int",",","then","two","values","will","be","sampled","independently","per","image",",","one","from","the","first","list","and","one","from","the","second",",","and","used","as","the","kernel","height","and","width",".","*","If","a","tuple","of","StochasticParameter",",","then","two","values","will","be","sampled","indepdently","per","image",",","one","from","the","first","parameter","and","one","from","the","second",",","and","used","as","the","kernel","height","and","width",".","keep_size",":","bool",",","optional","After","pooling",",","the","result","image","will","usually","have","a","different","height\/width","compared","to","the","original","input","image",".","If","this","parameter","is","set","to","True",",","then","the","pooled","image","will","be","resized","to","the","input","image","'s","size",",","i.e",".","the","augmenter","'s","output","shape","is","always","identical","to","the","input","shape",".","seed",":","None","or","int","or","imgaug.random.RNG","or","numpy.random.Generator","or","numpy.random.BitGenerator","or","numpy.random.SeedSequence","or","numpy.random.RandomState",",","optional","See",":","func",":","`","~imgaug.augmenters.meta.Augmenter.__init__","`",".","name",":","None","or","str",",","optional","See",":","func",":","`","~imgaug.augmenters.meta.Augmenter.__init__","`",".","random_state",":","None","or","int","or","imgaug.random.RNG","or","numpy.random.Generator","or","numpy.random.BitGenerator","or","numpy.random.SeedSequence","or","numpy.random.RandomState",",","optional","Old","name","for","parameter","`","seed","`",".","Its","usage","will","not","yet","cause","a","deprecation","warning",",","but","it","is","still","recommended","to","use","`","seed","`","now",".","Outdated","since","0.4.0.","deterministic",":","bool",",","optional","Deprecated","since","0.4.0",".","See","method","``","to_deterministic","(",")","``","for","an","alternative","and","for","details","about","what","the","``","deterministic","mode","''","actually","does",".","Examples","--","--","--","--",">",">",">","import","imgaug.augmenters","as","iaa",">",">",">","aug","=","iaa.MedianPooling","(","2",")","Create","an","augmenter","that","always","pools","with","a","kernel","size","of","``","2","x","2","``",".",">",">",">","aug","=","iaa.MedianPooling","(","2",",","keep_size=False",")","Create","an","augmenter","that","always","pools","with","a","kernel","size","of","``","2","x","2","``","and","does","*","not","*","resize","back","to","the","input","image","size",",","i.e",".","the","resulting","images","have","half","the","resolution",".",">",">",">","aug","=","iaa.MedianPooling","(","[","2",",","8","]",")","Create","an","augmenter","that","always","pools","either","with","a","kernel","size","of","``","2","x","2","``","or","``","8","x","8","``",".",">",">",">","aug","=","iaa.MedianPooling","(","(","1",",","7",")",")","Create","an","augmenter","that","always","pools","with","a","kernel","size","of","``","1","x","1","``","(","does","nothing",")","to","``","7","x","7","``",".","The","kernel","sizes","are","always","symmetric",".",">",">",">","aug","=","iaa.MedianPooling","(","(","(","1",",","7",")",",","(","1",",","7",")",")",")","Create","an","augmenter","that","always","pools","with","a","kernel","size","of","``","H","x","W","``","where","``","H","``","and","``","W","``","are","both","sampled","independently","from","the","range","``","[","1","..","7","]","``",".","E.g",".","resulting","kernel","sizes","could","be","``","3","x","7","``","or","``","5","x","1","``","."]
code: def __init__(
      self,
      kernel_size=(1, 5),
      keep_size=True,
      seed=None,
      name=None,
      random_state="deprecated",
      deterministic="deprecated",
  ):
      super(MedianPooling, self).__init__(
          kernel_size=kernel_size,
          keep_size=keep_size,
          seed=seed,
          name=name,
          random_state=random_state,
          deterministic=deterministic,
      )
  
imports: from __future__ import print_function, division, absolute_import
  from abc import ABCMeta, abstractmethod
  import functools
  import six
  import numpy
  import imgaug
  from .None import meta
  from ..None import parameters
label_desc: Use image node_id 1 to create a new MedianPooling object from inherited base classes: _AbstractPoolingBase with example: obj = MedianPooling(kernel_size, keep_size, seed, name, random_state, deterministic)