class_docstr: Resize sample to given size (width, height).
class_docstr_tok: ["Resize","sample","to","given","size","(","width",",","height",")","."]
docstr: Init.
  
  Args:
      width (int): desired output width
      height (int): desired output height
      resize_target (bool, optional):
          True: Resize the full sample (image, mask, target).
          False: Resize image only.
          Defaults to True.
      keep_aspect_ratio (bool, optional):
          True: Keep the aspect ratio of the input sample.
          Output sample might not have the given width and height, and
          resize behaviour depends on the parameter 'resize_method'.
          Defaults to False.
      ensure_multiple_of (int, optional):
          Output width and height is constrained to be multiple of this parameter.
          Defaults to 1.
      resize_method (str, optional):
          "lower_bound": Output will be at least as large as the given size.
          "upper_bound": Output will be at max as large as the given size. (Output size might be smaller than given size.)
          "minimal": Scale as least as possible.  (Output size might be smaller than given size.)
          Defaults to "lower_bound".
docstr_tok: ["Init",".","Args",":","width","(","int",")",":","desired","output","width","height","(","int",")",":","desired","output","height","resize_target","(","bool",",","optional",")",":","True",":","Resize","the","full","sample","(","image",",","mask",",","target",")",".","False",":","Resize","image","only",".","Defaults","to","True",".","keep_aspect_ratio","(","bool",",","optional",")",":","True",":","Keep","the","aspect","ratio","of","the","input","sample",".","Output","sample","might","not","have","the","given","width","and","height",",","and","resize","behaviour","depends","on","the","parameter","'resize_method","'",".","Defaults","to","False",".","ensure_multiple_of","(","int",",","optional",")",":","Output","width","and","height","is","constrained","to","be","multiple","of","this","parameter",".","Defaults","to","1.","resize_method","(","str",",","optional",")",":","``","lower_bound","''",":","Output","will","be","at","least","as","large","as","the","given","size",".","``","upper_bound","''",":","Output","will","be","at","max","as","large","as","the","given","size",".","(","Output","size","might","be","smaller","than","given","size",".",")","``","minimal","''",":","Scale","as","least","as","possible",".","(","Output","size","might","be","smaller","than","given","size",".",")","Defaults","to","``","lower_bound","''","."]
code: def __init__(
      self,
      width,
      height,
      resize_target=True,
      keep_aspect_ratio=False,
      ensure_multiple_of=1,
      resize_method="lower_bound",
      image_interpolation_method=3,
  ):
      """Init.
  
      Args:
          width (int): desired output width
          height (int): desired output height
          resize_target (bool, optional):
              True: Resize the full sample (image, mask, target).
              False: Resize image only.
              Defaults to True.
          keep_aspect_ratio (bool, optional):
              True: Keep the aspect ratio of the input sample.
              Output sample might not have the given width and height, and
              resize behaviour depends on the parameter 'resize_method'.
              Defaults to False.
          ensure_multiple_of (int, optional):
              Output width and height is constrained to be multiple of this parameter.
              Defaults to 1.
          resize_method (str, optional):
              "lower_bound": Output will be at least as large as the given size.
              "upper_bound": Output will be at max as large as the given size. (Output size might be smaller than given size.)
              "minimal": Scale as least as possible.  (Output size might be smaller than given size.)
              Defaults to "lower_bound".
      """
      self.__width = width
      self.__height = height
  
      self.__resize_target = resize_target
      self.__keep_aspect_ratio = keep_aspect_ratio
      self.__multiple_of = ensure_multiple_of
      self.__resize_method = resize_method
      self.__image_interpolation_method = image_interpolation_method
  
file_path: carefree-learn/cflearn/api/cv/third_party/midas/core/transforms.py
imports: import numpy
  import math
label_desc: Use image node_id 1 to create a new Resize object from inherited base classes: object with example: obj = Resize(width, height, resize_target, keep_aspect_ratio, ensure_multiple_of, resize_method, image_interpolation_method)