  
          if not self.verify_output and faces_count > 1:
              self.verify_output = True
  
      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
  
      def output_faces(self, filename, faces):
          """ Output faces to save thread """
          final_faces = list()
          for idx, detected_face in enumerate(faces["detected_faces"]):
              output_file = detected_face["file_location"]
 
</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             extension = Path(filename).suffix
 </s> add             extension = '.png' </s> remove         batch["detected_faces"] = [[face for face in faces
 </s> add         batch["detected_faces"] = [[face
                                    for face in faces </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", []))]
  
          if not self.verify_output and faces_count > 1:
              self.verify_output = True
  











      def output_faces(self, filename, faces):
          """ Output faces to save thread """
          final_faces = list()
          for idx, detected_face in enumerate(faces["detected_faces"]):
              output_file = detected_face["file_location"]
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
scripts/extract.py