class_docstr: MetadataWriter to write the metadata for image segmenter.
class_docstr_tok: ["MetadataWriter","to","write","the","metadata","for","image","segmenter","."]
docstr: Creates MetadataWriter to write the metadata for image segmenter.
  
  The parameters required in this method are mandatory when using MediaPipe
  Tasks.
  
  Example usage:
    metadata_writer = image_segmenter.Metadatawriter.create(model_buffer, ...)
    tflite_content, json_content = metadata_writer.populate()
  
  When calling `populate` function in this class, it returns TfLite content
  and JSON content. Note that only the output TFLite is used for deployment.
  The output JSON content is used to interpret the metadata content.
  
  Args:
    model_buffer: A valid flatbuffer loaded from the TFLite model file.
    input_norm_mean: the mean value used in the input tensor normalization
      [1].
    input_norm_std: the std value used in the input tensor normalizarion [1].
    labels: an instance of Labels helper class used in the output category
      tensor [2].
    activation: activation function for the output layer.
    [1]:
      https://github.com/google/mediapipe/blob/f8af41b1eb49ff4bdad756ff19d1d36f486be614/mediapipe/tasks/metadata/metadata_schema.fbs#L389
    [2]:
      https://github.com/google/mediapipe/blob/f8af41b1eb49ff4bdad756ff19d1d36f486be614/mediapipe/tasks/metadata/metadata_schema.fbs#L116
  
  Returns:
    A MetadataWriter object.
docstr_tok: ["Creates","MetadataWriter","to","write","the","metadata","for","image","segmenter",".","The","parameters","required","in","this","method","are","mandatory","when","using","MediaPipe","Tasks",".","Example","usage",":","metadata_writer","=","image_segmenter.Metadatawriter.create","(","model_buffer",",","...",")","tflite_content",",","json_content","=","metadata_writer.populate","(",")","When","calling","`","populate","`","function","in","this","class",",","it","returns","TfLite","content","and","JSON","content",".","Note","that","only","the","output","TFLite","is","used","for","deployment",".","The","output","JSON","content","is","used","to","interpret","the","metadata","content",".","Args",":","model_buffer",":","A","valid","flatbuffer","loaded","from","the","TFLite","model","file",".","input_norm_mean",":","the","mean","value","used","in","the","input","tensor","normalization","[","1","]",".","input_norm_std",":","the","std","value","used","in","the","input","tensor","normalizarion","[","1","]",".","labels",":","an","instance","of","Labels","helper","class","used","in","the","output","category","tensor","[","2","]",".","activation",":","activation","function","for","the","output","layer",".","[","1","]",":","https",":","\/\/github.com\/google\/mediapipe\/blob\/f8af41b1eb49ff4bdad756ff19d1d36f486be614\/mediapipe\/tasks\/metadata\/metadata_schema.fbs","#","L389","[","2","]",":","https",":","\/\/github.com\/google\/mediapipe\/blob\/f8af41b1eb49ff4bdad756ff19d1d36f486be614\/mediapipe\/tasks\/metadata\/metadata_schema.fbs","#","L116","Returns",":","A","MetadataWriter","object","."]
code: def create(
      cls,
      model_buffer: bytearray,
      input_norm_mean: List[float],
      input_norm_std: List[float],
      labels: Optional[metadata_writer.Labels] = None,
      activation: Optional[Activation] = None,
  ) -> "MetadataWriter":
      """Creates MetadataWriter to write the metadata for image segmenter.
  
      The parameters required in this method are mandatory when using MediaPipe
      Tasks.
  
      Example usage:
        metadata_writer = image_segmenter.Metadatawriter.create(model_buffer, ...)
        tflite_content, json_content = metadata_writer.populate()
  
      When calling `populate` function in this class, it returns TfLite content
      and JSON content. Note that only the output TFLite is used for deployment.
      The output JSON content is used to interpret the metadata content.
  
      Args:
        model_buffer: A valid flatbuffer loaded from the TFLite model file.
        input_norm_mean: the mean value used in the input tensor normalization
          [1].
        input_norm_std: the std value used in the input tensor normalizarion [1].
        labels: an instance of Labels helper class used in the output category
          tensor [2].
        activation: activation function for the output layer.
        [1]:
          https://github.com/google/mediapipe/blob/f8af41b1eb49ff4bdad756ff19d1d36f486be614/mediapipe/tasks/metadata/metadata_schema.fbs#L389
        [2]:
          https://github.com/google/mediapipe/blob/f8af41b1eb49ff4bdad756ff19d1d36f486be614/mediapipe/tasks/metadata/metadata_schema.fbs#L116
  
      Returns:
        A MetadataWriter object.
      """
      writer = metadata_writer.MetadataWriter(model_buffer)
      writer.add_general_info(_MODEL_NAME, _MODEL_DESCRIPTION)
      writer.add_image_input(input_norm_mean, input_norm_std)
      if activation is not None:
          option_md = ImageSegmenterOptionsMd(activation)
          writer.add_custom_metadata(option_md)
      num_output_tensors = writer_utils.get_subgraph(
          model_buffer
      ).OutputsLength()
      if num_output_tensors == 2:
          # For image segmenter model with 2 output tensors, the first one is
          # quality score, and the second one is matting mask.
          writer.add_feature_output(
              "quality score", "The quality score of matting result."
          )
      writer.add_segmentation_output(labels=labels)
      return cls(writer)
  
file_path: mediapipe/mediapipe/tasks/python/metadata/metadata_writers/image_segmenter.py
imports: import enum
  from typing import List, Optional
  import flatbuffers
  from mediapipe.tasks.metadata import image_segmenter_metadata_schema_py_generated
  from mediapipe.tasks.metadata import metadata_schema_py_generated
  from mediapipe.tasks.python.metadata import metadata
  from mediapipe.tasks.python.metadata.metadata_writers import metadata_info
  from mediapipe.tasks.python.metadata.metadata_writers import metadata_writer
  from mediapipe.tasks.python.metadata.metadata_writers import writer_utils
label_desc: Use image node_id 1 for calling the MetadataWriter obj's underlying member method code with example usage: obj.create(cls, model_buffer, input_norm_mean, input_norm_std, labels, activation) and returns: cls