          return _YAMLSerializer()
      if serializer.lower() == "yaml" and yaml is None:
          logger.warning("You must have PyYAML installed to use YAML as the serializer."
                         "Switching to JSON as the serializer.")
      logger.warning("Unrecognized serializer: '%s'. Returning json serializer", serializer)
      return _JSONSerializer()
  
  
  def get_serializer_from_filename(filename):
      """ Obtain a serializer object from a filename
  
 
</s> remove     if serializer.lower() == "json":
        return _JSONSerializer()
    if serializer.lower() == "pickle":
        return _PickleSerializer()
    if serializer.lower() == "yaml" and yaml is not None:
        return _YAMLSerializer()
    if serializer.lower() == "yaml" and yaml is None:
 </s> add     if serializer.lower() == "npy":
        retval = _NPYSerializer()
    elif serializer.lower() == "compressed":
        retval = _CompressedSerializer()
    elif serializer.lower() == "json":
        retval = _JSONSerializer()
    elif serializer.lower() == "pickle":
        retval = _PickleSerializer()
    elif serializer.lower() == "yaml" and yaml is not None:
        retval = _YAMLSerializer()
    elif serializer.lower() == "yaml" 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 </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     serializer: {'json', 'pickle', yaml'}
 </s> add     serializer: {'json', 'pickle', yaml', 'npy', '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)
        retval = _JSONSerializer
    else:
        logger.warning("Unrecognized serializer: '%s'. Returning json serializer", serializer)
    logger.debug(retval)
    return retval
          return _YAMLSerializer()
      if serializer.lower() == "yaml" and yaml is None:
          logger.warning("You must have PyYAML installed to use YAML as the serializer."
                         "Switching to JSON as the serializer.")
        retval = _JSONSerializer
    else:
        logger.warning("Unrecognized serializer: '%s'. Returning json serializer", serializer)
    logger.debug(retval)
    return retval
        retval = _JSONSerializer
    else:
        logger.warning("Unrecognized serializer: '%s'. Returning json serializer", serializer)
    logger.debug(retval)
    return retval
  
  
  def get_serializer_from_filename(filename):
      """ Obtain a serializer object from a filename
  
keep keep keep keep 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/serializer.py