code: def resize_norm_img(self, img):
      imgC, imgH, imgW = self.cls_image_shape
      h = img.shape[0]
      w = img.shape[1]
      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")
      if self.cls_image_shape[0] == 1:
          resized_image = resized_image / 255
          resized_image = resized_image[np.newaxis, :]
      else:
          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
  
file_path: PaddleOCR/tools/infer/predict_cls.py
imports: import os
  import sys
  import cv2
  import copy
  import numpy
  import math
  import time
  import traceback
  import tools.infer.utility
  from ppocr.postprocess import build_post_process
  from ppocr.utils.logging import get_logger
  from ppocr.utils.utility import get_image_file_list, check_and_read
label_desc: Use image node_id 2 for calling the TextClassifier obj's underlying member method code with example usage: obj.resize_norm_img(img) and returns: padding_im