code: def resize_norm_img(self, img, max_wh_ratio):
      imgC, imgH, imgW = self.rec_image_shape
  
      assert imgC == img.shape[2]
      imgW = int((imgH * max_wh_ratio))
      if self.use_onnx:
          w = self.input_tensor.shape[3:][0]
          if w is not None and w > 0:
              imgW = w
  
      h, w = img.shape[:2]
      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((imgC, imgH, imgW), dtype=np.float32)
      padding_im[:, :, 0:resized_w] = resized_image
      return padding_im
  
imports: import os
  import yaml
  import glob
  from functools import reduce
  import time
  import cv2
  import numpy
  import math
  import paddle
  import sys
  from python.infer import get_test_images
  from python.preprocess import preprocess, NormalizeImage, Permute, Resize_Mult32
  from pipeline.ppvehicle.vehicle_plateutils import create_predictor, get_infer_gpuid, get_rotate_crop_image, draw_boxes
  from pipeline.ppvehicle.vehicleplate_postprocess import build_post_process
  from pipeline.cfg_utils import merge_cfg, print_arguments, argsparser
label_desc: Use image node_id 2 for calling the TextRecognizer obj's underlying member method code with example usage: obj.resize_norm_img(img, max_wh_ratio) and returns: padding_im