class_docstr: Implements a face detector to detect profile pictures on resumes, IDS, driving licenses, passports...
  Based on open CV CascadeClassifier (haarcascades)
  
  Args:
  ----
      n_faces: maximal number of faces to detect on a single image, default = 1
docstr: Detect n_faces on the img
  
  Args:
  ----
      img: image to detect faces on
  
  Returns:
  -------
      A list of size n_faces, each face is a tuple of relative xmin, ymin, xmax, ymax
docstr_tok: ["Detect","n_faces","on","the","img","Args",":","--","--","img",":","image","to","detect","faces","on","Returns",":","--","--","--","-","A","list","of","size","n_faces",",","each","face","is","a","tuple","of","relative","xmin",",","ymin",",","xmax",",","ymax"]
code: def __call__(
      self,
      img: np.ndarray,
  ) -> List[Tuple[float, float, float, float]]:
      """Detect n_faces on the img
  
      Args:
      ----
          img: image to detect faces on
  
      Returns:
      -------
          A list of size n_faces, each face is a tuple of relative xmin, ymin, xmax, ymax
      """
      height, width = img.shape[:2]
      gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  
      faces = self.detector.detectMultiScale(gray, 1.5, 3)
      # If faces are detected, keep only the biggest ones
      rel_faces = []
      if len(faces) > 0:
          x, y, w, h = sorted(faces, key=lambda x: x[2] + x[3])[
              -min(self.n_faces, len(faces))
          ]
          xmin, ymin, xmax, ymax = (
              x / width,
              y / height,
              (x + w) / width,
              (y + h) / height,
          )
          rel_faces.append((xmin, ymin, xmax, ymax))
  
      return rel_faces
  
file_path: doctr/doctr/models/artefacts/face.py
imports: from typing import List, Tuple
  import cv2
  import numpy
  from doctr.utils.repr import NestedObject
label_desc: Use image node_id 3 for calling the FaceDetector obj's underlying member method code with example usage: obj.__call__(img) and returns: rel_faces