  
      @staticmethod
      def get_landmarks(filename):
          """ Extract the face from a frame (If not alignments file found) """
          image = cv2_read_img(filename, raise_error=True)
          feed = Sort.alignment_dict(image)
          feed["filename"] = filename
          queue_manager.get_queue("in").put(feed)
          face = queue_manager.get_queue("out").get()
          landmarks = face["detected_faces"][0].landmarks_xy
 
</s> remove             retval = cv2_read_img(filename, raise_error=True)
 </s> add             retval = read_image(filename, raise_error=True) </s> remove             image = cv2_read_img(src, raise_error=True)
 </s> add             image = read_image(src, raise_error=True) </s> remove     def get_landmarks(self, filename, image, side):
        """ Return the landmarks for this face """
        logger.trace("Retrieving landmarks: (filename: '%s', side: '%s'", filename, side)
        lm_key = sha1(image).hexdigest()
        try:
            src_points = self.landmarks[side][lm_key]
        except KeyError as err:
            msg = ("At least one of your images does not have a matching entry in your alignments "
                   "file."
 </s> add     def _get_landmarks(self, filenames, batch, side):
        """ Obtains the 68 Point Landmarks for the images in this batch. This is only called if
        config item ``warp_to_landmarks`` is ``True`` or if :attr:`mask_type` is not ``None``. If
        the landmarks for an image cannot be found, then an error is raised. """
        logger.trace("Retrieving landmarks: (filenames: '%s', side: '%s'", filenames, side)
        src_points = [self._landmarks[side].get(sha1(face).hexdigest(), None) for face in batch]

        # Raise error on missing alignments
        if not all(isinstance(pts, np.ndarray) for pts in src_points):
            indices = [idx for idx, hsh in enumerate(src_points) if hsh is None]
            missing = [filenames[idx] for idx in indices]
            msg = ("Files missing alignments for this batch: {}"
                   "\nAt least one of your images does not have a matching entry in your "
                   "alignments file." </s> remove             image = cv2_read_img(filename, raise_error=False)
 </s> add             image = read_image(filename, raise_error=False) </s> remove         f_hash, img = hash_encode_image(face, extension)
 </s> add         f_hash, img = encode_image_with_hash(face, extension)
        image = read_image(filename, raise_error=True)
  
      @staticmethod
      def get_landmarks(filename):
          """ Extract the face from a frame (If not alignments file found) """
        image = read_image(filename, raise_error=True)
          feed = Sort.alignment_dict(image)
          feed["filename"] = filename
          queue_manager.get_queue("in").put(feed)
          face = queue_manager.get_queue("out").get()
          landmarks = face["detected_faces"][0].landmarks_xy
keep keep keep keep replace keep keep keep keep keep
 Optimize Data Augmentation (#881)

* Move image utils to lib.image
* Add .pylintrc file
* Remove some cv2 pylint ignores
* TrainingData: Load images from disk in batches
* TrainingData: get_landmarks to batch
* TrainingData: transform and flip to batches
* TrainingData: Optimize color augmentation
* TrainingData: Optimize target and random_warp
* TrainingData - Convert _get_closest_match for batching
* TrainingData: Warp To Landmarks optimized
* Save models to threadpoolexecutor
* Move stack_images, Rename ImageManipulation. ImageAugmentation Docstrings
* Masks: Set dtype and threshold for lib.masks based on input face
* Docstrings and Documentation 
tools/sort.py