code: def preprocess(self, datas, batch_size):
      input_datas = []
      for img in datas:
          # 缩放
          h, w = img.shape[:2]
          img = cv2.resize(img, (224, 224))
  
          # 格式转换
          img = img.astype(np.float32)
  
          # 归一化
          for j in range(3):
              img[:, :, j] -= self.mean[j]
          for j in range(3):
              img[:, :, j] /= self.std[j]
          img /= 255.0
  
          # 格式转换
          img = img.transpose((2, 0, 1))
          img = img[np.newaxis, ...]
  
          input_datas.append(img)
  
      # 数据切分
      input_datas = np.concatenate(input_datas, 0)
      split_num = (
          len(datas) // batch_size + 1
          if len(datas) % batch_size != 0
          else len(datas) // batch_size
      )
      input_datas = np.array_split(input_datas, split_num)
      return input_datas
  
file_path: PaddleHub/modules/image/semantic_segmentation/ExtremeC3_Portrait_Segmentation/module.py
imports: import os
  import cv2
  import paddle
  import numpy
  from paddle.nn import Layer
  from paddlehub.module.module import moduleinfo
label_desc: Use image node_id 3 for calling the ExtremeC3_Portrait_Segmentation obj's underlying member method code with example usage: obj.preprocess(datas, batch_size) and returns: input_datas