class_docstr: Class that performs image segmentation on images.
  
  The API expects a TFLite model with mandatory TFLite Model Metadata.
  
  Input tensor:
    (kTfLiteUInt8/kTfLiteFloat32)
    - image input of size `[batch x height x width x channels]`.
    - batch inference is not supported (`batch` is required to be 1).
    - RGB and greyscale inputs are supported (`channels` is required to be
      1 or 3).
    - if type is kTfLiteFloat32, NormalizationOptions are required to be
      attached to the metadata for input normalization.
  Output tensors:
    (kTfLiteUInt8/kTfLiteFloat32)
    - list of segmented masks.
    - if `output_category_mask` is True, uint8 Image, Image vector of size 1.
    - if `output_confidence_masks` is True, float32 Image list of size
      `channels`.
    - batch is always 1
  
  An example of such model can be found at:
  https://tfhub.dev/tensorflow/lite-model/deeplabv3/1/metadata/2
class_docstr_tok: ["Class","that","performs","image","segmentation","on","images",".","The","API","expects","a","TFLite","model","with","mandatory","TFLite","Model","Metadata",".","Input","tensor",":","(","kTfLiteUInt8\/kTfLiteFloat32",")","-","image","input","of","size","`","[","batch","x","height","x","width","x","channels","]","`",".","-","batch","inference","is","not","supported","(","`","batch","`","is","required","to","be","1",")",".","-","RGB","and","greyscale","inputs","are","supported","(","`","channels","`","is","required","to","be","1","or","3",")",".","-","if","type","is","kTfLiteFloat32",",","NormalizationOptions","are","required","to","be","attached","to","the","metadata","for","input","normalization",".","Output","tensors",":","(","kTfLiteUInt8\/kTfLiteFloat32",")","-","list","of","segmented","masks",".","-","if","`","output_category_mask","`","is","True",",","uint8","Image",",","Image","vector","of","size","1",".","-","if","`","output_confidence_masks","`","is","True",",","float32","Image","list","of","size","`","channels","`",".","-","batch","is","always","1","An","example","of","such","model","can","be","found","at",":","https",":","\/\/tfhub.dev\/tensorflow\/lite-model\/deeplabv3\/1\/metadata\/2"]
docstr: Initializes the `ImageSegmenter` object.
docstr_tok: ["Initializes","the","`","ImageSegmenter","`","object","."]
code: def __init__(
      self, graph_config, running_mode, packet_callback
  ) -> None:
      """Initializes the `ImageSegmenter` object."""
      super(ImageSegmenter, self).__init__(
          graph_config, running_mode, packet_callback
      )
      self._populate_labels()
  
imports: import dataclasses
  from typing import Callable, List, Mapping, Optional
  from mediapipe.python import packet_creator
  from mediapipe.python import packet_getter
  from mediapipe.python._framework_bindings import image
  from mediapipe.python._framework_bindings import packet
  from mediapipe.tasks.cc.vision.image_segmenter.calculators import tensors_to_segmentation_calculator_pb2
  from mediapipe.tasks.cc.vision.image_segmenter.proto import image_segmenter_graph_options_pb2
  from mediapipe.tasks.cc.vision.image_segmenter.proto import segmenter_options_pb2
  from mediapipe.tasks.python.components.containers import rect
  from mediapipe.tasks.python.core import base_options
  from mediapipe.tasks.python.core import task_info
  from mediapipe.tasks.python.core.optional_dependencies import doc_controls
  from mediapipe.tasks.python.vision.core import base_vision_task_api
  from mediapipe.tasks.python.vision.core import image_processing_options
  from mediapipe.tasks.python.vision.core import vision_task_running_mode
label_desc: Use image node_id 1 to create a new ImageSegmenter object from inherited base classes: base_vision_task_api with example: obj = ImageSegmenter(graph_config, running_mode, packet_callback)