class_docstr: Resize sample to given size (width, height).
class_docstr_tok: ["Resize","sample","to","given","size","(","width",",","height",")","."]
code: def __call__(self, sample):
      width, height = self.get_size(
          sample["image"].shape[1], sample["image"].shape[0]
      )
  
      # resize sample
      sample["image"] = cv2.resize(
          sample["image"],
          (width, height),
          interpolation=self.__image_interpolation_method,
      )
  
      if self.__resize_target:
          if "disparity" in sample:
              sample["disparity"] = cv2.resize(
                  sample["disparity"],
                  (width, height),
                  interpolation=cv2.INTER_NEAREST,
              )
  
          if "depth" in sample:
              sample["depth"] = cv2.resize(
                  sample["depth"],
                  (width, height),
                  interpolation=cv2.INTER_NEAREST,
              )
  
          sample["mask"] = cv2.resize(
              sample["mask"].astype(np.float32),
              (width, height),
              interpolation=cv2.INTER_NEAREST,
          )
          sample["mask"] = sample["mask"].astype(bool)
  
      return sample
  
file_path: carefree-learn/cflearn/api/cv/third_party/midas/core/transforms.py
imports: import numpy
  import math
label_desc: Use image node_id 4 for calling the Resize obj's underlying member method code with example usage: obj.__call__(sample) and returns: sample