class_docstr: Class that performs interactive segmentation on images.
  
  Users can represent user interaction through `RegionOfInterest`, which gives
  a hint to InteractiveSegmenter to perform segmentation focusing on the given
  region of interest.
  
  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_type` is CATEGORY_MASK, uint8 Image, Image vector of size 1.
    - if `output_type` is CONFIDENCE_MASK, 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","interactive","segmentation","on","images",".","Users","can","represent","user","interaction","through","`","RegionOfInterest","`",",","which","gives","a","hint","to","InteractiveSegmenter","to","perform","segmentation","focusing","on","the","given","region","of","interest",".","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_type","`","is","CATEGORY_MASK",",","uint8","Image",",","Image","vector","of","size","1",".","-","if","`","output_type","`","is","CONFIDENCE_MASK",",","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: Creates the `InteractiveSegmenter` object from interactive segmenter options.
  
  Args:
    options: Options for the interactive segmenter task.
  
  Returns:
    `InteractiveSegmenter` object that's created from `options`.
  
  Raises:
    ValueError: If failed to create `InteractiveSegmenter` object from
      `InteractiveSegmenterOptions` such as missing the model.
    RuntimeError: If other types of error occurred.
docstr_tok: ["Creates","the","`","InteractiveSegmenter","`","object","from","interactive","segmenter","options",".","Args",":","options",":","Options","for","the","interactive","segmenter","task",".","Returns",":","`","InteractiveSegmenter","`","object","that","'s","created","from","`","options","`",".","Raises",":","ValueError",":","If","failed","to","create","`","InteractiveSegmenter","`","object","from","`","InteractiveSegmenterOptions","`","such","as","missing","the","model",".","RuntimeError",":","If","other","types","of","error","occurred","."]
code: def create_from_options(
      cls, options: InteractiveSegmenterOptions
  ) -> "InteractiveSegmenter":
      """Creates the `InteractiveSegmenter` object from interactive segmenter options.
  
      Args:
        options: Options for the interactive segmenter task.
  
      Returns:
        `InteractiveSegmenter` object that's created from `options`.
  
      Raises:
        ValueError: If failed to create `InteractiveSegmenter` object from
          `InteractiveSegmenterOptions` such as missing the model.
        RuntimeError: If other types of error occurred.
      """
  
      output_streams = [
          ":".join([_IMAGE_TAG, _IMAGE_OUT_STREAM_NAME]),
      ]
  
      if options.output_confidence_masks:
          output_streams.append(
              ":".join(
                  [_CONFIDENCE_MASKS_TAG, _CONFIDENCE_MASKS_STREAM_NAME]
              )
          )
  
      if options.output_category_mask:
          output_streams.append(
              ":".join([_CATEGORY_MASK_TAG, _CATEGORY_MASK_STREAM_NAME])
          )
  
      task_info = _TaskInfo(
          task_graph=_TASK_GRAPH_NAME,
          input_streams=[
              ":".join([_IMAGE_TAG, _IMAGE_IN_STREAM_NAME]),
              ":".join([_ROI_TAG, _ROI_STREAM_NAME]),
              ":".join([_NORM_RECT_TAG, _NORM_RECT_STREAM_NAME]),
          ],
          output_streams=output_streams,
          task_options=options,
      )
      return cls(
          task_info.generate_graph_config(enable_flow_limiting=False),
          _RunningMode.IMAGE,
          None,
      )
  
imports: import dataclasses
  import enum
  from typing import List, Optional
  from mediapipe.python import packet_creator
  from mediapipe.python import packet_getter
  from mediapipe.python._framework_bindings import image
  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 keypoint
  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
  from mediapipe.util import render_data_pb2
label_desc: Use image node_id 2 for calling the InteractiveSegmenter obj's underlying member method code with example usage: obj.create_from_options(cls, options) and returns: cls