class_docstr: Generic Metadata writer.
  
  Example usage:
  
  For an example model which requires two inputs: image and general feature
  inputs, and generates one output: classification.
  
  with open(model_path, 'rb') as f:
    writer = MetadataWriter.create(f.read())
    model_content, metadata_json_content = writer
        .add_genernal_info('model_name', 'model description')
        .add_image_input()
        .add_feature_input()
        .add_classification_output(Labels().add(['A', 'B']))
        .populate()
class_docstr_tok: ["Generic","Metadata","writer",".","Example","usage",":","For","an","example","model","which","requires","two","inputs",":","image","and","general","feature","inputs",",","and","generates","one","output",":","classification",".","with","open","(","model_path",",","'rb","'",")","as","f",":","writer","=","MetadataWriter.create","(","f.read","(",")",")","model_content",",","metadata_json_content","=","writer",".add_genernal_info","(","'model_name","'",",","'model","description","'",")",".add_image_input","(",")",".add_feature_input","(",")",".add_classification_output","(","Labels","(",")",".add","(","[","'","A","'",",","'","B","'","]",")",")",".populate","(",")"]
docstr: Adds a detection head metadata for detection output tensor of models without postprocessing.
  
  Args:
    labels: an instance of Labels helper class.
    output_tensors_order: the order of the output tensors. For models of
      out-of-graph non-maximum-suppression only.
  
  Returns:
    The current Writer instance to allow chained operation.
code: def add_raw_detection_output(
      self,
      labels: Optional[Labels] = None,
      output_tensors_order: metadata_info.RawDetectionOutputTensorsOrder = metadata_info.RawDetectionOutputTensorsOrder.UNSPECIFIED,
  ) -> "MetadataWriter":
      """Adds a detection head metadata for detection output tensor of models without postprocessing.
  
      Args:
        labels: an instance of Labels helper class.
        output_tensors_order: the order of the output tensors. For models of
          out-of-graph non-maximum-suppression only.
  
      Returns:
        The current Writer instance to allow chained operation.
      """
      label_files = self._create_label_file_md(labels)
      detection_output_mds = metadata_info.RawDetectionOutputTensorsMd(
          self._model_buffer,
          label_files=label_files,
          output_tensors_order=output_tensors_order,
      ).output_mds
      self._output_mds.extend(detection_output_mds)
      # Outputs are location, score.
      if len(detection_output_mds) != 2:
          raise ValueError("The size of detections output should be 2.")
      return self
  
imports: import collections
  import csv
  import dataclasses
  import os
  import tempfile
  from typing import List, Optional, Tuple, Union
  import flatbuffers
  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 writer_utils
label_desc: Use image node_id 11 for calling the MetadataWriter obj's underlying member method code with example usage: obj.add_raw_detection_output(labels, output_tensors_order) and returns: self