class_docstr: An abstract class representing a face detector.
  
  Any other face detection implementation must subclass it. All subclasses
  must implement ``detect_from_image``, that return a list of detected
  bounding boxes. Optionally, for speed considerations detect from path is
  recommended.
docstr: Detects faces from all the images present in a given directory.
  
  Arguments:
      path {string} -- a string containing a path that points to the folder containing the images
  
  Keyword Arguments:
      extensions {list} -- list of string containing the extensions to be
      consider in the following format: ``.extension_name`` (default:
      {['.jpg', '.png']}) recursive {bool} -- option wherever to scan the
      folder recursively (default: {False}) show_progress_bar {bool} --
      display a progressbar (default: {True})
  
  Example:
  >>> directory = 'data'
  ...   detected_faces = detect_from_directory(directory)
  {A dictionary of [lists containing bounding boxes(x1, y1, x2, y2)]}
docstr_tok: ["Detects","faces","from","all","the","images","present","in","a","given","directory",".","Arguments",":","path","{","string","}","--","a","string","containing","a","path","that","points","to","the","folder","containing","the","images","Keyword","Arguments",":","extensions","{","list","}","--","list","of","string","containing","the","extensions","to","be","consider","in","the","following","format",":","``",".extension_name","``","(","default",":","{","[","'.jpg","'",",","'.png","'","]","}",")","recursive","{","bool","}","--","option","wherever","to","scan","the","folder","recursively","(","default",":","{","False","}",")","show_progress_bar","{","bool","}","--","display","a","progressbar","(","default",":","{","True","}",")","Example",":",">",">",">","directory","=","'data'","...","detected_faces","=","detect_from_directory","(","directory",")","{","A","dictionary","of","[","lists","containing","bounding","boxes","(","x1",",","y1",",","x2",",","y2",")","]","}"]
code: def detect_from_directory(
      self,
      path,
      extensions=[".jpg", ".png"],
      recursive=False,
      show_progress_bar=True,
  ):
      """Detects faces from all the images present in a given directory.
  
      Arguments:
          path {string} -- a string containing a path that points to the folder containing the images
  
      Keyword Arguments:
          extensions {list} -- list of string containing the extensions to be
          consider in the following format: ``.extension_name`` (default:
          {['.jpg', '.png']}) recursive {bool} -- option wherever to scan the
          folder recursively (default: {False}) show_progress_bar {bool} --
          display a progressbar (default: {True})
  
      Example:
      >>> directory = 'data'
      ...   detected_faces = detect_from_directory(directory)
      {A dictionary of [lists containing bounding boxes(x1, y1, x2, y2)]}
  
      """
      if self.verbose:
          logger = logging.getLogger(__name__)
  
      if len(extensions) == 0:
          if self.verbose:
              logger.error(
                  "Expected at list one extension, but none was received."
              )
          raise ValueError
  
      if self.verbose:
          logger.info("Constructing the list of images.")
      additional_pattern = "/**/*" if recursive else "/*"
      files = []
      for extension in extensions:
          files.extend(
              glob.glob(
                  path + additional_pattern + extension,
                  recursive=recursive,
              )
          )
  
      if self.verbose:
          logger.info(
              "Finished searching for images. %s images found",
              len(files),
          )
          logger.info("Preparing to run the detection.")
  
      predictions = {}
      for image_path in tqdm(files, disable=not show_progress_bar):
          if self.verbose:
              logger.info(
                  "Running the face detector on image: %s", image_path
              )
          predictions[image_path] = self.detect_from_image(image_path)
  
      if self.verbose:
          logger.info(
              "The detector was successfully run on all %s images",
              len(files),
          )
  
      return predictions
  
file_path: face-alignment/face_alignment/detection/core.py
imports: import logging
  import glob
  from tqdm import tqdm
  import numpy
  import torch
  from skimage import io
label_desc: Use image node_id 4 for calling the FaceDetector obj's underlying member method code with example usage: obj.detect_from_directory(path, extensions, recursive, show_progress_bar) and returns: predictions