code: def preprocess(image):
      if image.mode == "L":
          image = image.convert("RGB")
      shrink, max_shrink = get_shrink(image.size[1], image.size[0])
      image_shape = [3, image.size[1], image.size[0]]
      if shrink != 1:
          h, w = int(image_shape[1] * shrink), int(
              image_shape[2] * shrink
          )
          image = image.resize((w, h), Image.ANTIALIAS)
          image_shape = [3, h, w]
  
      img = np.array(image)
      img = to_chw_bgr(img)
      mean = [104.0, 117.0, 123.0]
      scale = 0.007843
      img = img.astype("float32")
      img -= np.array(mean)[:, np.newaxis, np.newaxis].astype("float32")
      img = img * scale
      img = np.array(img)
      return img
  
file_path: PaddleHub/modules/image/face_detection/pyramidbox_face_detection/data_feed.py
imports: import os
  import time
  from collections import OrderedDict
  import cv2
  import numpy
  from PIL import Image
label_desc: Use image node_id 1 for calling a global function with example usage: preprocess(image) and returns: img