  
          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"]
              extension = Path(filename).suffix
 
</s> remove             extension = '.png'
 </s> add             extension = Path(filename).suffix </s> remove         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> add         self.align_face(faces, size, filename) </s> remove         feed_faces = np.stack([detected_face.feed_face / 255. for detected_face in detected_faces])
 </s> add         feed_faces = np.stack([detected_face.feed_face for detected_face in detected_faces]) </s> remove         retval = opts["warp_to_landmarks"]
 </s> add         retval = bool(opts.get("mask_type", None) or opts["warp_to_landmarks"]) </s> remove         retval = (self.model.training_opts.get("replicate_input_mask", False) or
                  self.model.training_opts.get("penalized_mask_loss", True))
 </s> add         retval = bool(self.model.training_opts.get("mask_type", None))
    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

  
          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"]
              extension = Path(filename).suffix
keep keep keep add keep keep keep keep keep keep
 Serialize masks to alignments file

- Add new serializers (npy + compressed)
- Remove Serializer option from cli
- Revert get_aligned call in scripts/extract
- Default alignments to compressed
- Size masks to 128px and compress
- Remove mask thresholding/blur from generation code
- Add Mask class to lib/faces_detect
- Revert debug landmarks to aligned face
- Revert non-extraction code to staging version 
scripts/extract.py