code: def get_ava_eval_data(
      scores,
      boxes,
      metadata,
      class_whitelist,
      verbose=False,
      video_idx_to_name=None,
  ):
      """
      Convert our data format into the data format used in official AVA
      evaluation.
      """
  
      out_scores = defaultdict(list)
      out_labels = defaultdict(list)
      out_boxes = defaultdict(list)
      count = 0
      for i in range(scores.shape[0]):
          video_idx = int(np.round(metadata[i][0]))
          sec = int(np.round(metadata[i][1]))
  
          video = video_idx_to_name[video_idx]
  
          key = video + "," + "%04d" % (sec)
          batch_box = boxes[i].tolist()
          # The first is batch idx.
          batch_box = [batch_box[j] for j in [0, 2, 1, 4, 3]]
  
          one_scores = scores[i].tolist()
          for cls_idx, score in enumerate(one_scores):
              if cls_idx + 1 in class_whitelist:
                  out_scores[key].append(score)
                  out_labels[key].append(cls_idx + 1)
                  out_boxes[key].append(batch_box[1:])
                  count += 1
  
      return out_boxes, out_labels, out_scores
  
file_path: SlowFast/slowfast/utils/ava_eval_helper.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import csv
  import logging
  import pprint
  import time
  from collections import defaultdict
  import numpy
  import slowfast.utils.distributed
  from ava_evaluation import object_detection_evaluation, standard_fields
  from slowfast.utils.env import pathmgr
label_desc: Use image node_id 8 for calling a global function with example usage: get_ava_eval_data(scores, boxes, metadata, class_whitelist, verbose, video_idx_to_name) and returns: out_boxes,  out_labels,  out_scores