code: def detect_faces(
      face_detector: Any,
      detector_backend: str,
      img: np.ndarray,
      align: bool = True,
  ) -> list:
      """
      Detect face(s) from a given image
      Args:
          face_detector (Any): pre-built face detector object
          detector_backend (str): detector name
          img (np.ndarray): pre-loaded image
          alig (bool): enable or disable alignment after detection
      Returns
          result (list): tuple of face (np.ndarray), face region (list)
              , confidence score (float)
      """
      backends = {
          "opencv": OpenCvWrapper.detect_face,
          "ssd": SsdWrapper.detect_face,
          "dlib": DlibWrapper.detect_face,
          "mtcnn": MtcnnWrapper.detect_face,
          "retinaface": RetinaFaceWrapper.detect_face,
          "mediapipe": MediapipeWrapper.detect_face,
          "yolov8": YoloWrapper.detect_face,
          "yunet": YunetWrapper.detect_face,
          "fastmtcnn": FastMtcnnWrapper.detect_face,
      }
  
      detect_face_fn = backends.get(detector_backend)
  
      if detect_face_fn:  # pylint: disable=no-else-return
          obj = detect_face_fn(face_detector, img, align)
          # obj stores list of (detected_face, region, confidence)
          return obj
      else:
          raise ValueError(
              "invalid detector_backend passed - " + detector_backend
          )
  
file_path: deepface/deepface/detectors/FaceDetector.py
imports: from typing import Any, Union
  from PIL import Image
  import numpy
  from deepface.detectors import OpenCvWrapper, SsdWrapper, DlibWrapper, MtcnnWrapper, RetinaFaceWrapper, MediapipeWrapper, YoloWrapper, YunetWrapper, FastMtcnnWrapper
label_desc: Use image node_id 3 for calling a global function with example usage: detect_faces(face_detector, detector_backend, img, align) and returns: obj