          batch["center_scale"] = self.get_center_scale(batch["detected_faces"])
          faces = self.crop(batch)
          logger.trace("Aligned image around center")
          faces = self._normalize_faces(faces)
          batch["feed"] = np.array(faces, dtype="float32").transpose((0, 3, 1, 2)) / 255.0
          return batch
  
      def get_center_scale(self, detected_faces):
          """ Get the center and set scale of bounding box """
          logger.trace("Calculating center and scale")
 
</s> remove         batch["feed"] = np.array(faces, dtype="float32").transpose((0, 3, 1, 2))
 </s> add         batch["feed"] = np.array(faces, dtype="float32")[..., :3].transpose((0, 3, 1, 2)) </s> remove                                    for dim, faces in zip(dims,
                                                         batch.get("detected_faces", list()))]
 </s> add                                    for dim, faces in zip(dims, batch.get("detected_faces", []))] </s> remove         batch["detected_faces"] = [[face for face in faces
 </s> add         batch["detected_faces"] = [[face
                                    for face in faces </s> remove         self.image = image[self.top: self.bottom,
 </s> add         self.face = image[self.top: self.bottom, </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 
        batch["feed"] = np.array(faces, dtype="float32")[..., :3].transpose((0, 3, 1, 2)) / 255.0
          batch["center_scale"] = self.get_center_scale(batch["detected_faces"])
          faces = self.crop(batch)
          logger.trace("Aligned image around center")
          faces = self._normalize_faces(faces)
        batch["feed"] = np.array(faces, dtype="float32")[..., :3].transpose((0, 3, 1, 2)) / 255.0
          return batch
  
      def get_center_scale(self, detected_faces):
          """ Get the center and set scale of bounding box """
          logger.trace("Calculating center and scale")
keep keep keep keep replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

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