code: def detect_face(model, image, shrink):
      image_shape = [image.shape[0], image.shape[1]]
      if shrink != 1:
          h, w = int(image_shape[0] * shrink), int(
              image_shape[1] * shrink
          )
          image = cv2.resize(image, (w, h))
          image_shape = [h, w]
  
      img = face_img_process(image)
      image_shape = np.asarray([image_shape])
      scale_factor = np.asarray([[shrink, shrink]])
      data = {
          "image": paddle.to_tensor(img, dtype="float32"),
          "im_shape": paddle.to_tensor(image_shape, dtype="float32"),
          "scale_factor": paddle.to_tensor(
              scale_factor, dtype="float32"
          ),
      }
      model.eval()
      detection = model(data)
      detection = detection["bbox"].numpy()
      # layout: xmin, ymin, xmax. ymax, score
      if np.prod(detection.shape) == 1:
          logger.info("No face detected")
          return np.array([[0, 0, 0, 0, 0]])
      det_conf = detection[:, 1]
      det_xmin = detection[:, 2]
      det_ymin = detection[:, 3]
      det_xmax = detection[:, 4]
      det_ymax = detection[:, 5]
  
      det = np.column_stack(
          (det_xmin, det_ymin, det_xmax, det_ymax, det_conf)
      )
      return det
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import cv2
  import numpy
  from collections import OrderedDict
  import paddle
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 2 for calling a global function with example usage: detect_face(model, image, shrink) and returns: det, np