class_docstr: Object representing heatmaps on a single image.
  
  Parameters
  ----------
  arr : (H,W) ndarray or (H,W,C) ndarray
      Array representing the heatmap(s) on a single image.
      Multiple heatmaps may be provided, in which case ``C`` is expected to
      denote the heatmap index.
      The array must be of dtype ``float32``.
  
  shape : tuple of int
      Shape of the image on which the heatmap(s) is/are placed.
      **Not** the shape of the heatmap(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 heatmap(s) array
      (analogous ``W_arr``).
  
  min_value : float, optional
      Minimum value for the heatmaps that `arr` represents. This will
      usually be ``0.0``.
  
  max_value : float, optional
      Maximum value for the heatmaps that `arr` represents. This will
      usually be ``1.0``.
class_docstr_tok: ["Object","representing","heatmaps","on","a","single","image",".","Parameters","--","--","--","--","--","arr",":","(","H",",","W",")","ndarray","or","(","H",",","W",",","C",")","ndarray","Array","representing","the","heatmap","(","s",")","on","a","single","image",".","Multiple","heatmaps","may","be","provided",",","in","which","case","``","C","``","is","expected","to","denote","the","heatmap","index",".","The","array","must","be","of","dtype","``","float32","``",".","shape",":","tuple","of","int","Shape","of","the","image","on","which","the","heatmap","(","s",")","is\/are","placed",".","*","*","Not","*","*","the","shape","of","the","heatmap","(","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","heatmap","(","s",")","array","(","analogous","``","W_arr","``",")",".","min_value",":","float",",","optional","Minimum","value","for","the","heatmaps","that","`","arr","`","represents",".","This","will","usually","be","``","0.0","``",".","max_value",":","float",",","optional","Maximum","value","for","the","heatmaps","that","`","arr","`","represents",".","This","will","usually","be","``","1.0","``","."]
docstr: Pad the heatmaps until they match a target aspect ratio.
  
  Depending on which dimension is smaller (height or width), only the
  corresponding sides (left/right or top/bottom) will be padded. In
  each case, both of the sides will be padded equally.
  
  Parameters
  ----------
  aspect_ratio : float
      Target aspect ratio, given as width/height. E.g. ``2.0`` denotes
      the image having twice as much width as height.
  
  mode : str, optional
      Padding mode to use.
      See :func:`~imgaug.imgaug.pad` for details.
  
  cval : number, optional
      Value to use for padding if `mode` is ``constant``.
      See :func:`~imgaug.imgaug.pad` for details.
  
  return_pad_amounts : bool, optional
      If ``False``, then only the padded instance will be returned.
      If ``True``, a tuple with two entries will be returned, where
      the first entry is the padded instance and the second entry are
      the amounts by which each array side was padded. These amounts are
      again a tuple of the form ``(top, right, bottom, left)``, with
      each value being an integer.
  
  Returns
  -------
  imgaug.augmentables.heatmaps.HeatmapsOnImage
      Padded heatmaps as :class:`HeatmapsOnImage` instance.
  
  tuple of int
      Amounts by which the instance's array was padded on each side,
      given as a tuple ``(top, right, bottom, left)``.
      This tuple is only returned if `return_pad_amounts` was set to
      ``True``.
docstr_tok: ["Pad","the","heatmaps","until","they","match","a","target","aspect","ratio",".","Depending","on","which","dimension","is","smaller","(","height","or","width",")",",","only","the","corresponding","sides","(","left\/right","or","top\/bottom",")","will","be","padded",".","In","each","case",",","both","of","the","sides","will","be","padded","equally",".","Parameters","--","--","--","--","--","aspect_ratio",":","float","Target","aspect","ratio",",","given","as","width\/height",".","E.g",".","``","2.0","``","denotes","the","image","having","twice","as","much","width","as","height",".","mode",":","str",",","optional","Padding","mode","to","use",".","See",":","func",":","`","~imgaug.imgaug.pad","`","for","details",".","cval",":","number",",","optional","Value","to","use","for","padding","if","`","mode","`","is","``","constant","``",".","See",":","func",":","`","~imgaug.imgaug.pad","`","for","details",".","return_pad_amounts",":","bool",",","optional","If","``","False","``",",","then","only","the","padded","instance","will","be","returned",".","If","``","True","``",",","a","tuple","with","two","entries","will","be","returned",",","where","the","first","entry","is","the","padded","instance","and","the","second","entry","are","the","amounts","by","which","each","array","side","was","padded",".","These","amounts","are","again","a","tuple","of","the","form","``","(","top",",","right",",","bottom",",","left",")","``",",","with","each","value","being","an","integer",".","Returns","--","--","--","-","imgaug.augmentables.heatmaps.HeatmapsOnImage","Padded","heatmaps","as",":","class",":","`","HeatmapsOnImage","`","instance",".","tuple","of","int","Amounts","by","which","the","instance","'s","array","was","padded","on","each","side",",","given","as","a","tuple","``","(","top",",","right",",","bottom",",","left",")","``",".","This","tuple","is","only","returned","if","`","return_pad_amounts","`","was","set","to","``","True","``","."]
code: def pad_to_aspect_ratio(
      self,
      aspect_ratio,
      mode="constant",
      cval=0.0,
      return_pad_amounts=False,
  ):
      """Pad the heatmaps until they match a target aspect ratio.
  
      Depending on which dimension is smaller (height or width), only the
      corresponding sides (left/right or top/bottom) will be padded. In
      each case, both of the sides will be padded equally.
  
      Parameters
      ----------
      aspect_ratio : float
          Target aspect ratio, given as width/height. E.g. ``2.0`` denotes
          the image having twice as much width as height.
  
      mode : str, optional
          Padding mode to use.
          See :func:`~imgaug.imgaug.pad` for details.
  
      cval : number, optional
          Value to use for padding if `mode` is ``constant``.
          See :func:`~imgaug.imgaug.pad` for details.
  
      return_pad_amounts : bool, optional
          If ``False``, then only the padded instance will be returned.
          If ``True``, a tuple with two entries will be returned, where
          the first entry is the padded instance and the second entry are
          the amounts by which each array side was padded. These amounts are
          again a tuple of the form ``(top, right, bottom, left)``, with
          each value being an integer.
  
      Returns
      -------
      imgaug.augmentables.heatmaps.HeatmapsOnImage
          Padded heatmaps as :class:`HeatmapsOnImage` instance.
  
      tuple of int
          Amounts by which the instance's array was padded on each side,
          given as a tuple ``(top, right, bottom, left)``.
          This tuple is only returned if `return_pad_amounts` was set to
          ``True``.
  
      """
      from ..augmenters import size as iasize
  
      arr_0to1_padded, pad_amounts = iasize.pad_to_aspect_ratio(
          self.arr_0to1,
          aspect_ratio=aspect_ratio,
          mode=mode,
          cval=cval,
          return_pad_amounts=True,
      )
      # TODO change to deepcopy()
      heatmaps = HeatmapsOnImage.from_0to1(
          arr_0to1_padded,
          shape=self.shape,
          min_value=self.min_value,
          max_value=self.max_value,
      )
      if return_pad_amounts:
          return heatmaps, pad_amounts
      return heatmaps
  
imports: from __future__ import print_function, division, absolute_import
  import numpy
  import six.moves
  from ..None import imgaug
  from .base import IAugmentable
label_desc: Use image node_id 7 for calling the HeatmapsOnImage obj's underlying member method code with example usage: obj.pad_to_aspect_ratio(aspect_ratio, mode, cval, return_pad_amounts) and returns: heatmaps, heatmaps,  pad_amounts