code: def load_det_results(det_file, num_frames):
      assert os.path.exists(det_file) and os.path.isfile(
          det_file
      ), "{} is not exist or not a file.".format(det_file)
      labels = np.loadtxt(det_file, dtype="float32", delimiter=",")
      assert (
          labels.shape[1] == 7
      ), "Each line of {} should have 7 items: '[frame_id],[x0],[y0],[w],[h],[score],[class_id]'.".format(
          det_file
      )
      results_list = []
      for frame_i in range(num_frames):
          results = {"bbox": [], "score": [], "cls_id": []}
          lables_with_frame = labels[labels[:, 0] == frame_i + 1]
          # each line of lables_with_frame:
          # [frame_id],[x0],[y0],[w],[h],[score],[class_id]
          for l in lables_with_frame:
              results["bbox"].append(l[1:5])
              results["score"].append(l[5:6])
              results["cls_id"].append(l[6:7])
          results_list.append(results)
      return results_list
  
imports: import os
  import cv2
  import time
  import numpy
  import collections
  import math
label_desc: Use image node_id 2 for calling a global function with example usage: load_det_results(det_file, num_frames) and returns: results_list