code: def resize_norm_img_cls(self, img):
      cls_image_shape = [3, 48, 192]
      imgC, imgH, imgW = 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 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
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import ast
  import copy
  import math
  import os
  import time
  import cv2
  import numpy
  import paddle
  from chinese_ocr_db_crnn_server.character import CharacterOps
  from chinese_ocr_db_crnn_server.utils import base64_to_cv2
  from chinese_ocr_db_crnn_server.utils import draw_ocr
  from chinese_ocr_db_crnn_server.utils import get_image_ext
  from chinese_ocr_db_crnn_server.utils import sorted_boxes
  from paddle.inference import Config
  from paddle.inference import create_predictor
  from PIL import Image
  import paddlehub
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.module import runnable
  from paddlehub.module.module import serving
  from paddlehub.utils.log import logger
label_desc: Use image node_id 7 for calling the ChineseOCRDBCRNNServer obj's underlying member method code with example usage: obj.resize_norm_img_cls(img) and returns: padding_im