      Parameters
      ----------
      filenames: list
          A list of ``str`` full paths to the images to be loaded.
      show_progress: bool, optional
          Display a progress bar. Default: False
  
      Yields
      -------
      tuple: (`filename`, :func:`hashlib.hexdigest()` representation of the `sha1` hash of the image)
      Example
 
</s> remove     # Get landmarks
    def _transform_landmarks(self, side, detected_faces):
        """ Transform frame landmarks to their aligned face variant.

        Parameters
        ----------
        side: {"a" or "b"}
            The side currently being processed
        detected_faces: list
            A list of :class:`lib.faces_detect.DetectedFace` objects

        Returns
        -------
        dict
            The face filenames as keys with the aligned landmarks as value.
        """
        landmarks = dict()
        for face in detected_faces:
            face.load_aligned(None, size=self._training_opts["training_size"])
            for filename in self._hash_to_filenames(side, face.hash):
                landmarks[filename] = face.aligned_landmarks
        return landmarks

    # Get masks
    def _get_masks(self, side, detected_faces):
        """ For each face, obtain the mask and set the requested blurring and threshold level.

        Parameters
        ----------
        side: {"a" or "b"}
            The side currently being processed
        detected_faces: list
            A list of :class:`lib.faces_detect.DetectedFace` objects

        Returns
        -------
        dict
            The face filenames as keys with the :class:`lib.faces_detect.Mask` as value.
        """

        masks = dict()
        for face in detected_faces:
            mask = face.mask[self._training_opts["mask_type"]]
            mask.set_blur_kernel_and_threshold(blur_kernel=self._training_opts["mask_blur_kernel"],
                                               threshold=self._training_opts["mask_threshold"])
            for filename in self._hash_to_filenames(side, face.hash):
                masks[filename] = mask
        return masks

 </s> add     # Utils </s> remove             For keys "a" and "b" the values are a ``dict`` containing keys "hashes" and "filenames"
            with their values being a list of hashes and filenames that exist within the training
            data folder
 </s> add             For keys "a" and "b" the values are a ``dict`` with the key being the sha1 hash and
            the value being a list of filenames that correspond to the hash for images that exist
            within the training data folder </s> remove     # Load alignments
 </s> add     def _get_masks(self, side, detected_faces):
        """ For each face, obtain the mask and set the requested blurring and threshold level.

        Parameters
        ----------
        side: {"a" or "b"}
            The side currently being processed
        detected_faces: dict
            Key is the hash of the face, value is the corresponding
            :class:`lib.faces_detect.DetectedFace` object

        Returns
        -------
        dict
            The face filenames as keys with the :class:`lib.faces_detect.Mask` as value.
        """

        masks = dict()
        for fhash, face in detected_faces.items():
            mask = face.mask[self._training_opts["mask_type"]]
            mask.set_blur_kernel_and_threshold(blur_kernel=self._training_opts["mask_blur_kernel"],
                                               threshold=self._training_opts["mask_threshold"])
            for filename in self._hash_to_filenames(side, fhash):
                masks[filename] = mask
        return masks

    # Pre flight checks
    def _check_alignments_exist(self):
        """ Ensure the alignments files exist prior to running any longer running tasks.

        Raises
        ------
        FaceswapError
            If at least one alignments file does not exist
        """
        for fullpath in self._training_opts["alignments"].values():
            if not os.path.exists(fullpath):
                raise FaceswapError("Alignments file does not exist: `{}`".format(fullpath))

    # Hashes for image folders </s> remove             For keys "a" and "b" values are a list of :class:`lib.faces_detect.DetectedFace`
            objects.
 </s> add             For keys "a" and "b" values are a dict with the key being the sha1 hash of the face
            and the value being the corresponding :class:`lib.faces_detect.DetectedFace` object.
      Parameters
      ----------
      filenames: list
          A list of ``str`` full paths to the images to be loaded.


  
      Yields
      -------
      tuple: (`filename`, :func:`hashlib.hexdigest()` representation of the `sha1` hash of the image)
      Example
keep keep keep keep replace replace keep keep keep keep keep
 plugins.train.trainer - Speed up mask caching 
lib/image.py