code: def image_vis_summaries(
      pred_dict,
      config=None,
      extra_tag=None,
      image_visualization_mode=None,
      image=None,
      gt_bboxes=None,
  ):
      summaries = []
      if config.type == "fasterrcnn":
          summaries.extend(
              get_image_summaries(
                  summaries_fn["fasterrcnn"][image_visualization_mode][
                      "rpn"
                  ],
                  pred_dict,
                  image,
                  gt_bboxes,
                  extra_tag=extra_tag,
              )
          )
  
          if config.network.with_rcnn and summaries_fn["fasterrcnn"][
              image_visualization_mode
          ].get("rcnn"):
              summaries.extend(
                  get_image_summaries(
                      summaries_fn["fasterrcnn"][
                          image_visualization_mode
                      ]["rcnn"],
                      pred_dict,
                      image,
                      gt_bboxes,
                      extra_tag=extra_tag,
                  )
              )
      elif config.type == "ssd":
          summaries.extend(
              get_image_summaries(
                  summaries_fn["ssd"][image_visualization_mode],
                  pred_dict,
                  image,
                  gt_bboxes,
                  extra_tag=extra_tag,
              )
          )
  
      return summaries
  
imports: import io
  import numpy
  import os
  import logging
  import PIL.Image
  import PIL.ImageDraw
  import PIL.ImageFont
  import tensorflow
  from .bbox_overlap import bbox_overlap
  from .bbox_transform import decode
  from base64 import b64encode
  from sys import stdout
label_desc: Use image node_id 2 for calling a global function with example usage: image_vis_summaries(pred_dict, config, extra_tag, image_visualization_mode, image, gt_bboxes) and returns: summaries