docstr: :param payload: RGB channel
  :return: pre-processed image, and transform info (p_b_w, p_b_h, pad_size_h, pad_size_w)
docstr_tok: [":","param","payload",":","RGB","channel",":","return",":","pre-processed","image",",","and","transform","info","(","p_b_w",",","p_b_h",",","pad_size_h",",","pad_size_w",")"]
code: def __preprocess(self, payload: object = None):
      """
      :param payload: RGB channel
      :return: pre-processed image, and transform info (p_b_w, p_b_h, pad_size_h, pad_size_w)
      """
      self.original_h, self.original_w, _ = payload.shape
      if float(self.original_h) / self.original_w >= float(
          self.image_height
      ) / float(self.image_width):
          resize_ratio = (float(self.original_h) * self.image_width) / (
              float(self.original_w) * self.image_height
          )
          pad_size = (
              self.original_h,
              int(self.original_w * resize_ratio),
          )
      else:
          resize_ratio = (
              float(self.original_w) * self.image_height
          ) / (float(self.original_h) * self.image_width)
          pad_size = (
              int(self.original_h * resize_ratio),
              self.original_w,
          )
  
      p_b_h = (pad_size[0] - self.original_h) // 2
      p_b_w = (pad_size[1] - self.original_w) // 2
      p_a_h = pad_size[0] - self.original_h - p_b_h
      p_a_w = pad_size[1] - self.original_w - p_b_w
  
      pad_width = ((p_b_h, p_a_h), (p_b_w, p_a_w), (0, 0))
      transform_info = (p_b_w, p_b_h, pad_size[0], pad_size[1])
  
      image = payload.astype(np.float32)
  
      # noramlize the image
      image = (image - self.mean) / self.std
  
      # image padding
      image = np.pad(image, pad_width)
  
      # image resize (for opencv, width come first)
      image = cv2.resize(
          image,
          (self.image_width, self.image_height),
          interpolation=cv2.INTER_LINEAR,
      )
  
      # noramlize the image
      # image = (image - self.mean) / self.std
  
      # convert to CxHXW
      image = np.transpose(image, (2, 0, 1))
  
      return image[None, ...], transform_info
  
file_path: gluon-cv/scripts/pose/directpose/tvm_evaluation/pose_model.py
imports: import tvm
  from tvm.contrib import graph_runtime
  from typing import List
  import cv2
  import numpy
label_desc: Use image node_id 4 for calling the PoseEstimationInferenceModel obj's underlying member method code with example usage: obj.__preprocess(payload) and returns: image,  transform_info