  class _PickleSerializer(Serializer):
      """ Pickle Serializer """
      def __init__(self):
          super().__init__()
          self._file_extension = "p"
  
      @classmethod
      def _marshal(cls, data):
          return pickle.dumps(data)
  
 
</s> remove         return yaml.load(data.decode("utf-8"))
 </s> add         return yaml.load(data.decode("utf-8"), Loader=yaml.FullLoader) </s> remove             logger.debug("Serializer set from argument: '%s'", serializer)
            retval = get_serializer(serializer)
 </s> add             logger.debug("Returning default Pickle serializer")
            retval = get_serializer("compressed") </s> remove     def set_serializer(self):
        """ Set the serializer to be used for loading and
            saving alignments """
        if hasattr(self.args, "serializer") and self.args.serializer:
            logger.debug("Serializer provided: '%s'", self.args.serializer)
            serializer = self.args.serializer
        else:
            # If there is a full filename then this will be overriden
            # by filename extension
            serializer = "json"
            logger.debug("No Serializer defaulting to: '%s'", serializer)
        return serializer

 </s> add  </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))
        self._file_extension = "pickle"
  class _PickleSerializer(Serializer):
      """ Pickle Serializer """
      def __init__(self):
          super().__init__()
        self._file_extension = "pickle"
  
      @classmethod
      def _marshal(cls, data):
          return pickle.dumps(data)
  
keep keep keep keep replace 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 
lib/serializer.py