code: def convert_to_json(metadata_buffer: bytearray) -> str:
      """Converts the metadata into a json string.
  
      Args:
        metadata_buffer: valid metadata buffer in bytes.
  
      Returns:
        Metadata in JSON format.
  
      Raises:
        ValueError: error occurred when parsing the metadata schema file.
      """
      return metadata.convert_to_json(
          metadata_buffer,
          custom_metadata_schema={
              _METADATA_NAME: _FLATC_METADATA_SCHEMA_FILE
          },
      )
  
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 a global function with example usage: convert_to_json(metadata_buffer) and returns: metadata