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 an input image metadata for the image input.
  
  Args:
    norm_mean: The mean value used to normalize each input channel. If there
      is only one element in the list, its value will be broadcasted to all
      channels. Also note that norm_mean and norm_std should have the same
      number of elements. [1]
    norm_std: The std value used to normalize each input channel. If there is
      only one element in the list, its value will be broadcasted to all
      channels. [1]
    color_space_type: The color space type of the input image. [2]
    name: Name of the input tensor.
    description: Description of the input tensor.
  
  Returns:
    The MetadataWriter instance, can be used for chained operation.
  
  [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#L198
code: def add_image_input(
      self,
      norm_mean: List[float],
      norm_std: List[float],
      color_space_type: Optional[int] = metadata_fb.ColorSpaceType.RGB,
      name: str = _INPUT_IMAGE_NAME,
      description: str = _INPUT_IMAGE_DESCRIPTION,
  ) -> "MetadataWriter":
      """Adds an input image metadata for the image input.
  
      Args:
        norm_mean: The mean value used to normalize each input channel. If there
          is only one element in the list, its value will be broadcasted to all
          channels. Also note that norm_mean and norm_std should have the same
          number of elements. [1]
        norm_std: The std value used to normalize each input channel. If there is
          only one element in the list, its value will be broadcasted to all
          channels. [1]
        color_space_type: The color space type of the input image. [2]
        name: Name of the input tensor.
        description: Description of the input tensor.
  
      Returns:
        The MetadataWriter instance, can be used for chained operation.
  
      [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#L198
      """
      input_md = metadata_info.InputImageTensorMd(
          name=name,
          description=description,
          norm_mean=norm_mean,
          norm_std=norm_std,
          color_space_type=color_space_type,
          tensor_type=self._input_tensor_type(len(self._input_mds)),
      )
  
      self._input_mds.append(input_md)
      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 6 for calling the MetadataWriter obj's underlying member method code with example usage: obj.add_image_input(norm_mean, norm_std, color_space_type, name, description) and returns: self