              face.hash, image = encode_image_with_hash(face.aligned_face, extension)
  
              saver.save(output_filename, image)
              final_faces.append(face.to_alignment())
          self._alignments.data[os.path.basename(extract_media.filename)] = final_faces
          del extract_media
 
</s> remove             face_count = len(alignments)
 </s> add             face_count = len(val["faces"]) </s> remove         del self.data[frame][idx]
        logger.debug("Deleted face: (frame: '%s', idx %s)", frame, idx)
 </s> add         del self._data[frame_name]["faces"][face_index]
        logger.debug("Deleted face: (frame_name: '%s', face_index %s)", frame_name, face_index) </s> remove         hashset = set(hashlist)
        for filename, frame in self.data.items():
            for idx, face in reversed(list(enumerate(frame))):
 </s> add         hashset = set(hash_list)
        for filename, val in self._data.items():
            for idx, face in reversed(list(enumerate(val["faces"]))): </s> remove                     del frame[idx]
 </s> add                     del val["faces"][idx] </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():
        self._alignments.data[os.path.basename(extract_media.filename)] = dict(faces=final_faces)
              face.hash, image = encode_image_with_hash(face.aligned_face, extension)
  
              saver.save(output_filename, image)
              final_faces.append(face.to_alignment())
        self._alignments.data[os.path.basename(extract_media.filename)] = dict(faces=final_faces)
          del extract_media
keep keep keep keep replace keep
 lib.alignments - Slight update (#978)

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