code: def sodac(
      iou_matrices,
      scorer,
      predicted_captions,
      gt_captions,
      splits,
      iou_thresholds=(0.0,),
  ):
      """SODA_c from https://github.com/fujiso/SODA/."""
      if not predicted_captions:
          return {int(split): 0 for split in splits}
  
      res = {
          str(index): [p] for index, p in enumerate(predicted_captions)
      }
      unique_splits = set(splits)
      fs = {
          int(split): [0] * len(iou_thresholds)
          for split in unique_splits
      }
      for split in unique_splits:
          split_idx = np.where(splits == split)[0]
          split_gt_captions = [gt_captions[idx] for idx in split_idx]
          gts = [
              {index: [x] for index in res} for x in split_gt_captions
          ]
          iou_matrix = iou_matrices[int(split)]
          score_matrix = np.array(
              [
                  np.nan_to_num(scorer.compute_score(res, gt)[1])
                  for gt in gts
              ]
          )
          for i, threshold in enumerate(iou_thresholds):
              iou_cur = np.copy(iou_matrix)
              iou_cur[iou_cur < threshold] = 0.0
              max_score, _ = chased_dp_assignment(
                  iou_cur * score_matrix
              )
              (n_g, n_p) = iou_cur.shape
              p = max_score / n_p
              r = max_score / n_g
              fs[int(split)][i] = (
                  2 * p * r / (p + r) if p + r > 0 else 0
              )
      for split in unique_splits:
          fs[int(split)] = np.mean(fs[int(split)])
      return fs
  
imports: import collections
  import logging
  import random
  import re
  import string
  import numpy
  from scenic.projects.vid2seq.metrics.cider import Cider
  from scenic.projects.vid2seq.metrics.meteor import Meteor
  from scenic.projects.vid2seq.metrics.ptbtokenizer import PTBTokenizer
label_desc: Use image node_id 9 for calling a global function with example usage: sodac(iou_matrices, scorer, predicted_captions, gt_captions, splits, iou_thresholds) and returns: fs, unknown