code: def draw_all_character(visualizer, characters, w):
      start_index = 2
      y_index = 5
      for char in characters:
          if isinstance(char, str):
              visualizer.draw_texts(
                  str(char),
                  positions=np.array([start_index, y_index]),
                  colors=(0, 0, 0),
                  font_families="monospace",
              )
              start_index += len(char) * 8
          else:
              visualizer.draw_texts(
                  str(char[0]),
                  positions=np.array([start_index, y_index]),
                  colors=char[1],
                  font_families="monospace",
              )
              start_index += len(char[0]) * 8
  
          if start_index > w - 10:
              start_index = 2
              y_index += 15
  
      drawn_text = visualizer.get_image()
      return drawn_text
  
file_path: mmdetection/tools/analysis_tools/browse_grounding_dataset.py
imports: import argparse
  import os.path
  import numpy
  from mmcv.image import imwrite
  from mmengine.config import Config, DictAction
  from mmengine.registry import init_default_scope
  from mmengine.utils import ProgressBar
  from mmdet.registry import DATASETS, VISUALIZERS
  from mmdet.structures.bbox import BaseBoxes
label_desc: Use image node_id 2 for calling a global function with example usage: draw_all_character(visualizer, characters, w) and returns: drawn_text