      def yield_faces(self):
          """ Yield face alignments for one image """
          for frame_fullname, alignments in self.data.items():
              frame_name = os.path.splitext(frame_fullname)[0]
              face_count = len(alignments)
              logger.trace("Yielding: (frame: '%s', faces: %s, frame_fullname: '%s')",
                           frame_name, face_count, frame_fullname)
              yield frame_name, alignments, face_count, frame_fullname
  
      @staticmethod
 
</s> remove             yield frame_name, alignments, face_count, frame_fullname

    @staticmethod
    def yield_original_index_reverse(image_alignments, number_alignments):
        """ Return the correct original index for
            alignment in reverse order """
        for idx, _ in enumerate(reversed(image_alignments)):
            original_idx = number_alignments - 1 - idx
            logger.trace("Yielding: face index %s", original_idx)
            yield original_idx
 </s> add             yield frame_name, val["faces"], face_count, frame_fullname </s> remove         """ Yield face alignments for one image """
        for frame_fullname, alignments in self.data.items():
 </s> add         """ Generator to obtain all faces with meta information from :attr:`data`. The results
        are yielded by frame.

        Notes
        -----
        The yielded order is non-deterministic.

        Yields
        ------
        frame_name: str
            The frame name that the face belongs to. This is the base name of the frame, as it
            appears in :attr:`data`, not the full path
        faces: list
            The list of face `dict` objects that exist for this frame
        face_count: int
            The number of faces that exist within :attr:`data` for this frame
        frame_fullname: str
            The full path (folder and filename) for the yielded frame
        """
        for frame_fullname, val in self._data.items(): </s> remove             for frame_name, faces in self.data.items():
                for idx, face in enumerate(faces):
 </s> add             for frame_name, val in self._data.items():
                for idx, face in enumerate(val["faces"]): </s> remove     def add_face(self, frame, alignment):
        """ Add a new face for a frame and return it's index """
        logger.debug("Adding face to frame: '%s'", frame)
        if frame not in self.data:
            self.data[frame] = []
        self.data[frame].append(alignment)
        retval = self.count_faces_in_frame(frame) - 1
 </s> add     def add_face(self, frame_name, face):
        """ Add a new face for the given frame_name in :attr:`data` and return it's index.

        Parameters
        ----------
        frame_name: str
            The frame name to add the face to. This should be the base name of the frame, not the
            full path
        face: dict
            The face information to add to the given frame_name, correctly formatted for storing in
            :attr:`data`

        Returns
        -------
        int
            The index of the newly added face within :attr:`data` for the given frame_name
        """
        logger.debug("Adding face to frame_name: '%s'", frame_name)
        if frame_name not in self._data:
            self._data[frame_name] = dict(faces=[])
        self._data[frame_name]["faces"].append(face)
        retval = self._count_faces_in_frame(frame_name) - 1
            face_count = len(val["faces"])
      def yield_faces(self):
          """ Yield face alignments for one image """
          for frame_fullname, alignments in self.data.items():
              frame_name = os.path.splitext(frame_fullname)[0]
            face_count = len(val["faces"])
              logger.trace("Yielding: (frame: '%s', faces: %s, frame_fullname: '%s')",
                           frame_name, face_count, frame_fullname)
              yield frame_name, alignments, face_count, frame_fullname
  
      @staticmethod
keep keep keep keep replace keep keep keep keep keep
 lib.alignments - Slight update (#978)

* lib.alignments update:
  - Minor structure change (faces to nested dictionary)
  - Refactor internal and external methods
  - Documentation 
lib/alignments.py