code: def preprocess(org_im, scale, rotation):
      image = org_im.copy()
      image_height, image_width, _ = image.shape
  
      aspect_ratio = scale[1] * 1.0 / scale[0]
      image_center, image_scale = _box2cs(
          [0, 0, image_width - 1, image_height - 1], aspect_ratio
      )
  
      trans = get_affine_transform(
          image_center, image_scale, rotation, scale
      )
      image = cv2.warpAffine(
          image,
          trans,
          (int(scale[1]), int(scale[0])),
          flags=cv2.INTER_LINEAR,
          borderMode=cv2.BORDER_CONSTANT,
          borderValue=(0, 0, 0),
      )
  
      img_mean = np.array([0.406, 0.456, 0.485]).reshape((1, 1, 3))
      img_std = np.array([0.225, 0.224, 0.229]).reshape((1, 1, 3))
      image = image.astype(np.float32)
      image = (image / 255.0 - img_mean) / img_std
      image = image.transpose(2, 0, 1).astype(np.float32)
  
      image_info = {
          "image_center": image_center,
          "image_height": image_height,
          "image_width": image_width,
          "image_scale": image_scale,
          "rotation": rotation,
          "scale": scale,
      }
  
      return image, image_info
  
file_path: PaddleHub/modules/image/semantic_segmentation/ace2p/data_feed.py
imports: import os
  import time
  from collections import OrderedDict
  import cv2
  import numpy
  from .processor import get_affine_transform
label_desc: Use image node_id 3 for calling a global function with example usage: preprocess(org_im, scale, rotation) and returns: image,  image_info