code: def action_preprocess(input, preprocess_ops):
      """
      input (str | numpy.array): if input is str, it should be a legal file path with numpy array saved.
                                 Otherwise it should be numpy.array as direct input.
      return (numpy.array)
      """
      if isinstance(input, str):
          assert (
              os.path.isfile(input) is not None
          ), "{0} not exists".format(input)
          data = np.load(input)
      else:
          data = input
      for operator in preprocess_ops:
          data = operator(data)
      return data
  
imports: import os
  import yaml
  import glob
  import cv2
  import numpy
  import math
  import paddle
  import sys
  from paddle.inference import Config, create_predictor
  from python.utils import argsparser, Timer, get_current_memory_mb
  from python.benchmark_utils import PaddleInferBenchmark
  from python.infer import Detector, print_arguments
  from attr_infer import AttrDetector
label_desc: Use image node_id 1 for calling a global function with example usage: action_preprocess(input, preprocess_ops) and returns: data