code: def __call__(self, image, label):
      value_scale = 255
      mean = [0.485, 0.456, 0.406]
      mean = [item * value_scale for item in mean]
      std = [0.229, 0.224, 0.225]
      std = [item * value_scale for item in std]
  
      def find_new_hw(ori_h, ori_w, test_size):
          if ori_h >= ori_w:
              ratio = test_size * 1.0 / ori_h
              new_h = test_size
              new_w = int(ori_w * ratio)
          elif ori_w > ori_h:
              ratio = test_size * 1.0 / ori_w
              new_h = int(ori_h * ratio)
              new_w = test_size
  
          if new_h % 8 != 0:
              new_h = (int(new_h / 8)) * 8
          else:
              new_h = new_h
          if new_w % 8 != 0:
              new_w = (int(new_w / 8)) * 8
          else:
              new_w = new_w
          return new_h, new_w
  
      test_size = self.size
      new_h, new_w = find_new_hw(
          image.shape[0], image.shape[1], test_size
      )
      # new_h, new_w = test_size, test_size
      image_crop = cv2.resize(
          image,
          dsize=(int(new_w), int(new_h)),
          interpolation=cv2.INTER_LINEAR,
      )
      back_crop = np.zeros((test_size, test_size, 3))
      # back_crop[:,:,0] = mean[0]
      # back_crop[:,:,1] = mean[1]
      # back_crop[:,:,2] = mean[2]
      back_crop[:new_h, :new_w, :] = image_crop
      image = back_crop
  
      s_mask = label
      new_h, new_w = find_new_hw(
          s_mask.shape[0], s_mask.shape[1], test_size
      )
      # new_h, new_w = test_size, test_size
      s_mask = cv2.resize(
          s_mask.astype(np.float32),
          dsize=(int(new_w), int(new_h)),
          interpolation=cv2.INTER_NEAREST,
      )
      back_crop_s_mask = np.ones((test_size, test_size)) * 255
      back_crop_s_mask[:new_h, :new_w] = s_mask
      label = back_crop_s_mask
  
      return image, label
  
imports: import random
  import math
  import numpy
  import numbers
  import collections
  import cv2
  import torch
  import time
label_desc: Use image node_id 2 for calling the Resize obj's underlying member method code with example usage: obj.__call__(image, label) and returns: image,  label, new_h,  new_w