docstr: Scan a directory for images with a given extension type(s) and predict the landmarks for each
      face present in the images found.
  
   Arguments:
      path {str} -- path to the target directory containing the images
  
  Keyword Arguments:
      extensions {list of str} -- list containing the image extensions considered (default: ['.jpg', '.png'])
      recursive {boolean} -- If True, scans for images recursively (default: True)
      show_progress_bar {boolean} -- If True displays a progress bar (default: True)
      return_bboxes {boolean} -- If True, return the face bounding boxes in addition to the keypoints.
      return_landmark_score {boolean} -- If True, return the keypoint scores along with the keypoints.
docstr_tok: ["Scan","a","directory","for","images","with","a","given","extension","type","(","s",")","and","predict","the","landmarks","for","each","face","present","in","the","images","found",".","Arguments",":","path","{","str","}","--","path","to","the","target","directory","containing","the","images","Keyword","Arguments",":","extensions","{","list","of","str","}","--","list","containing","the","image","extensions","considered","(","default",":","[","'.jpg","'",",","'.png","'","]",")","recursive","{","boolean","}","--","If","True",",","scans","for","images","recursively","(","default",":","True",")","show_progress_bar","{","boolean","}","--","If","True","displays","a","progress","bar","(","default",":","True",")","return_bboxes","{","boolean","}","--","If","True",",","return","the","face","bounding","boxes","in","addition","to","the","keypoints",".","return_landmark_score","{","boolean","}","--","If","True",",","return","the","keypoint","scores","along","with","the","keypoints","."]
code: def get_landmarks_from_directory(
      self,
      path,
      extensions=[".jpg", ".png"],
      recursive=True,
      show_progress_bar=True,
      return_bboxes=False,
      return_landmark_score=False,
  ):
      """Scan a directory for images with a given extension type(s) and predict the landmarks for each
          face present in the images found.
  
       Arguments:
          path {str} -- path to the target directory containing the images
  
      Keyword Arguments:
          extensions {list of str} -- list containing the image extensions considered (default: ['.jpg', '.png'])
          recursive {boolean} -- If True, scans for images recursively (default: True)
          show_progress_bar {boolean} -- If True displays a progress bar (default: True)
          return_bboxes {boolean} -- If True, return the face bounding boxes in addition to the keypoints.
          return_landmark_score {boolean} -- If True, return the keypoint scores along with the keypoints.
      """
      dataset = FolderData(
          path,
          self.face_detector.tensor_or_path_to_ndarray,
          extensions,
          recursive,
          self.verbose,
      )
      dataloader = torch.utils.data.DataLoader(
          dataset,
          batch_size=1,
          shuffle=False,
          num_workers=2,
          prefetch_factor=4,
      )
  
      predictions = {}
      for image_path, image in tqdm(
          dataloader, disable=not show_progress_bar
      ):
          image_path, image = image_path[0], image[0]
          bounding_boxes = self.face_detector.detect_from_image(image)
          if return_bboxes or return_landmark_score:
              preds, bbox, score = self.get_landmarks_from_image(
                  image,
                  bounding_boxes,
                  return_bboxes=return_bboxes,
                  return_landmark_score=return_landmark_score,
              )
              predictions[image_path] = (preds, bbox, score)
          else:
              preds = self.get_landmarks_from_image(
                  image, bounding_boxes
              )
              predictions[image_path] = preds
  
      return predictions
  
file_path: face-alignment/face_alignment/api.py
imports: import torch
  import warnings
  from enum import IntEnum
  from skimage import io
  import numpy
  from packaging import version
  from tqdm import tqdm
  from .utils import *
  from .folder_data import FolderData
label_desc: Use image node_id 5 for calling the FaceAlignment obj's underlying member method code with example usage: obj.get_landmarks_from_directory(path, extensions, recursive, show_progress_bar, return_bboxes, return_landmark_score) and returns: predictions