code: def get_image_summaries(
      summaries_fn, pred_dict, image, gt_bboxes=None, extra_tag=None
  ):
      summaries = []
      if gt_bboxes is not None:
          pred_dict["gt_bboxes"] = gt_bboxes
  
      for fn_name, arguments in summaries_fn.items():
          if not arguments:
              arguments = [{}]
  
          for argument in arguments:
              if not argument:
                  argument = {}
                  tag = fn_name
              else:
                  tag = os.path.join(
                      fn_name,
                      ",".join(
                          "{}={}".format(k, v)
                          for k, v in argument.items()
                      ),
                  )
              if extra_tag:
                  tag = "{}/{}".format(tag, extra_tag)
              try:
                  summary = image_to_summary(
                      globals()[fn_name](pred_dict, image, **argument),
                      tag,
                  )
                  summaries.append(summary)
              except KeyError as err:
                  tf.logging.warning(
                      "Function {} failed with KeyError. Key value: {}".format(
                          fn_name, err
                      )
                  )
      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 1 for calling a global function with example usage: get_image_summaries(summaries_fn, pred_dict, image, gt_bboxes, extra_tag) and returns: summaries