code: def build_model(detector_backend: str) -> Any:
      """
      Build a face detector model
      Args:
          detector_backend (str): backend detector name
      Returns:
          built detector (Any)
      """
      global face_detector_obj  # singleton design pattern
  
      backends = {
          "opencv": OpenCvWrapper.build_model,
          "ssd": SsdWrapper.build_model,
          "dlib": DlibWrapper.build_model,
          "mtcnn": MtcnnWrapper.build_model,
          "retinaface": RetinaFaceWrapper.build_model,
          "mediapipe": MediapipeWrapper.build_model,
          "yolov8": YoloWrapper.build_model,
          "yunet": YunetWrapper.build_model,
          "fastmtcnn": FastMtcnnWrapper.build_model,
      }
  
      if not "face_detector_obj" in globals():
          face_detector_obj = {}
  
      built_models = list(face_detector_obj.keys())
      if detector_backend not in built_models:
          face_detector = backends.get(detector_backend)
  
          if face_detector:
              face_detector = face_detector()
              face_detector_obj[detector_backend] = face_detector
          else:
              raise ValueError(
                  "invalid detector_backend passed - "
                  + detector_backend
              )
  
      return face_detector_obj[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 1 for calling a global function with example usage: build_model(detector_backend) and returns: face_detector_obj