class_docstr: This class contains all needed functions to work with faces in a frame
docstr: Detect faces in a frame
  
  Args:
      frame (cv2 image): a normal frame grab from camera or video
      
  Outputs:
      rects (array): detected faces as rectangles
docstr_tok: ["Detect","faces","in","a","frame","Args",":","frame","(","cv2","image",")",":","a","normal","frame","grab","from","camera","or","video","Outputs",":","rects","(","array",")",":","detected","faces","as","rectangles"]
code: def face_detection(self, frame):
      """
      Detect faces in a frame
  
      Args:
          frame (cv2 image): a normal frame grab from camera or video
  
      Outputs:
          rects (array): detected faces as rectangles
      """
      if self.detector is None:
          self.detector = dlib.get_frontal_face_detector()
  
      if frame is None:
          return
  
      gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
      # get all faces in the frame
      rects = self.detector(gray, 0)
      # to get the coords from a rect, use: (x, y, w, h) = face_utils.rect_to_bb(rects[0])
  
      return rects
  
file_path: heart-rate-measurement-camera/face_utilities.py
imports: import cv2
  import numpy
  import dlib
  from imutils import face_utils
  import imutils
  from collections import OrderedDict
label_desc: Use image node_id 3 for calling the Face_utilities obj's underlying member method code with example usage: obj.face_detection(frame) and returns: rects