          """
  
          for face, landmarks in zip(batch["detected_faces"], batch["landmarks"]):
              face.landmarks_xy = [(int(round(pt[0])), int(round(pt[1]))) for pt in landmarks]
  
          self._remove_invalid_keys(batch, ("detected_faces", "filename", "image"))
          logger.trace("Item out: %s", {key: val
                                        for key, val in batch.items()
                                        if key != "image"})
          for filename, image, face in zip(batch["filename"],
 
</s> remove         for face, landmarks in zip(batch["detected_faces"], batch["landmarks"]):
 </s> add         generator = zip(batch["detected_faces"],
                        batch["filename"],
                        batch["image"],
                        batch["landmarks"])
        for face, filename, image, landmarks in generator: </s> remove                 padding)
 </s> add                 self.aligned["padding"]) </s> remove         self.align_face(faces, size, filename)
 </s> add         final_faces = list()
        for detected_face in faces["detected_faces"]:
            filename = self.output_dir / Path(detected_face.filename).stem
            final_faces.append({"file_location": filename,
                                "face": detected_face})
        faces["detected_faces"] = final_faces </s> remove     def align_face(self, faces, size, filename):
        """ Align the detected face and add the destination file path """
        final_faces = list()
        image = faces["image"]
        detected_faces = faces["detected_faces"]
        for face in detected_faces:
            face.load_aligned(image, size=size)
            final_faces.append({"file_location": self.output_dir / Path(filename).stem,
                                "face": face})
        faces["detected_faces"] = final_faces

 </s> add 
            face.image = image
            face.filename = filename
          """
  
          for face, landmarks in zip(batch["detected_faces"], batch["landmarks"]):
              face.landmarks_xy = [(int(round(pt[0])), int(round(pt[1]))) for pt in landmarks]
            face.image = image
            face.filename = filename
          self._remove_invalid_keys(batch, ("detected_faces", "filename", "image"))
          logger.trace("Item out: %s", {key: val
                                        for key, val in batch.items()
                                        if key != "image"})
          for filename, image, face in zip(batch["filename"],
keep keep keep keep replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
plugins/extract/align/_base.py