code: def load_boxes_and_labels(cfg, mode):
      """
      Loading boxes and labels from csv files.
  
      Args:
          cfg (CfgNode): config.
          mode (str): 'train', 'val', or 'test' mode.
      Returns:
          all_boxes (dict): a dict which maps from `video_name` and
              `frame_sec` to a list of `box`. Each `box` is a
              [`box_coord`, `box_labels`] where `box_coord` is the
              coordinates of box and 'box_labels` are the corresponding
              labels for the box.
      """
      gt_lists = cfg.AVA.TRAIN_GT_BOX_LISTS if mode == "train" else []
      pred_lists = (
          cfg.AVA.TRAIN_PREDICT_BOX_LISTS
          if mode == "train"
          else cfg.AVA.TEST_PREDICT_BOX_LISTS
      )
      ann_filenames = [
          os.path.join(cfg.AVA.ANNOTATION_DIR, filename)
          for filename in gt_lists + pred_lists
      ]
      ann_is_gt_box = [True] * len(gt_lists) + [False] * len(pred_lists)
  
      detect_thresh = cfg.AVA.DETECTION_SCORE_THRESH
      # Only select frame_sec % 4 = 0 samples for validation if not
      # set FULL_TEST_ON_VAL.
      boxes_sample_rate = (
          4 if mode == "val" and not cfg.AVA.FULL_TEST_ON_VAL else 1
      )
      all_boxes, count, unique_box_count = parse_bboxes_file(
          ann_filenames=ann_filenames,
          ann_is_gt_box=ann_is_gt_box,
          detect_thresh=detect_thresh,
          boxes_sample_rate=boxes_sample_rate,
      )
      logger.info(
          "Finished loading annotations from: %s"
          % ", ".join(ann_filenames)
      )
      logger.info("Detection threshold: {}".format(detect_thresh))
      logger.info("Number of unique boxes: %d" % unique_box_count)
      logger.info("Number of annotations: %d" % count)
  
      return all_boxes
  
file_path: SlowFast/slowfast/datasets/ava_helper.py
imports: import logging
  import os
  from collections import defaultdict
  from slowfast.utils.env import pathmgr
label_desc: Use image node_id 2 for calling a global function with example usage: load_boxes_and_labels(cfg, mode) and returns: all_boxes