          extension = os.path.splitext(filename)[1]
          if extension in (".json", ".p", ".yaml", ".yml"):
              logger.debug("Serializer set from filename extension: '%s'", extension)
              retval = get_serializer_from_filename(filename)
          elif serializer not in ("json", "pickle", "yaml"):
              raise ValueError("Error: {} is not a valid serializer. Use "
                               "'json', 'pickle' or 'yaml'")
          else:
              logger.debug("Serializer set from argument: '%s'", serializer)
              retval = get_serializer(serializer)
          logger.verbose("Using '%s' serializer for alignments", retval.file_extension)
          return retval
 
</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             specified serializer will be used """
        logger.debug("Getting serializer: (filename: '%s', serializer: '%s')",
                     filename, serializer)
 </s> add             compressed pickle will be used """
        logger.debug("Getting serializer: (filename: '%s')", filename) </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         return _JSONSerializer()
    if extension == ".p":
        return _PickleSerializer()
    if extension in (".yaml", ".yml") and yaml is not None:
        return _YAMLSerializer()
    if extension in (".yaml", ".yml") and yaml is None:
 </s> add         retval = _JSONSerializer()
    elif extension == ".p":
        retval = _PickleSerializer()
    elif extension == ".npy":
        retval = _NPYSerializer()
    elif extension == ".fsc":
        retval = _CompressedSerializer()
    elif extension in (".yaml", ".yml") and yaml is not None:
        retval = _YAMLSerializer()
    elif extension in (".yaml", ".yml") and yaml is None: </s> remove     logger.warning("Unrecognized extension: '%s'. Returning json serializer", extension)
    return _JSONSerializer()
 </s> add         retval = _JSONSerializer()
    else:
        logger.warning("Unrecognized extension: '%s'. Returning json serializer", extension)
        retval = _JSONSerializer()
    logger.debug(retval)
    return retval
          extension = os.path.splitext(filename)[1]
          if extension in (".json", ".p", ".yaml", ".yml"):
              logger.debug("Serializer set from filename extension: '%s'", extension)
              retval = get_serializer_from_filename(filename)



          else:
              logger.debug("Serializer set from argument: '%s'", serializer)
              retval = get_serializer(serializer)
          logger.verbose("Using '%s' serializer for alignments", retval.file_extension)
          return retval
keep keep keep keep replace replace 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/alignments.py