code: def resize_norm_img(self, data, imgW, imgH, padding=True):
      img = data["image"]
      h = img.shape[0]
      w = img.shape[1]
      if not padding:
          resized_image = cv2.resize(
              img, (imgW, imgH), interpolation=cv2.INTER_LINEAR
          )
          resized_w = imgW
      else:
          ratio = w / float(h)
          if math.ceil(imgH * ratio) > imgW:
              resized_w = imgW
          else:
              resized_w = int(math.ceil(imgH * ratio))
          resized_image = cv2.resize(img, (resized_w, imgH))
      resized_image = resized_image.astype("float32")
  
      resized_image = resized_image.transpose((2, 0, 1)) / 255
      resized_image -= 0.5
      resized_image /= 0.5
      padding_im = np.zeros((3, imgH, imgW), dtype=np.float32)
      padding_im[:, :, :resized_w] = resized_image
      valid_ratio = min(1.0, float(resized_w / imgW))
      data["image"] = padding_im
      data["valid_ratio"] = valid_ratio
      return data
  
imports: import numpy
  import cv2
  import math
  import os
  import json
  import random
  import traceback
  from paddle.io import Dataset
  from .imaug import transform, create_operators
label_desc: Use image node_id 3 for calling the MultiScaleDataSet obj's underlying member method code with example usage: obj.resize_norm_img(data, imgW, imgH, padding) and returns: data