code: def get_mtmct_matching_results(
      pred_mtmct_file, secs_interval=0.5, video_fps=20
  ):
      res = np.loadtxt(
          pred_mtmct_file
      )  # 'cid, tid, fid, x1, y1, w, h, -1, -1'
      camera_ids = list(map(int, np.unique(res[:, 0])))
  
      res = res[:, :7]
      # each line in res: 'cid, tid, fid, x1, y1, w, h'
  
      camera_tids = []
      camera_results = dict()
      for c_id in camera_ids:
          camera_results[c_id] = res[res[:, 0] == c_id]
          tids = np.unique(camera_results[c_id][:, 1])
          tids = list(map(int, tids))
          camera_tids.append(tids)
  
      # select common tids throughout each video
      common_tids = reduce(np.intersect1d, camera_tids)
      if len(common_tids) == 0:
          print(
              "No common tracked ids in these videos, please check your MOT result or select new videos."
          )
          return None, None
  
      # get mtmct matching results by cid_tid_fid_results[c_id][t_id][f_id]
      cid_tid_fid_results = dict()
      cid_tid_to_fids = dict()
      interval = int(
          secs_interval * video_fps
      )  # preferably less than 10
      for c_id in camera_ids:
          cid_tid_fid_results[c_id] = dict()
          cid_tid_to_fids[c_id] = dict()
          for t_id in common_tids:
              tid_mask = camera_results[c_id][:, 1] == t_id
              cid_tid_fid_results[c_id][t_id] = dict()
  
              camera_trackid_results = camera_results[c_id][tid_mask]
              fids = np.unique(camera_trackid_results[:, 2])
              fids = fids[fids % interval == 0]
              fids = list(map(int, fids))
              cid_tid_to_fids[c_id][t_id] = fids
  
              for f_id in fids:
                  st_frame = f_id
                  ed_frame = f_id + interval
  
                  st_mask = camera_trackid_results[:, 2] >= st_frame
                  ed_mask = camera_trackid_results[:, 2] < ed_frame
                  frame_mask = np.logical_and(st_mask, ed_mask)
                  cid_tid_fid_results[c_id][t_id][
                      f_id
                  ] = camera_trackid_results[frame_mask]
  
      return camera_results, cid_tid_fid_results
  
file_path: PaddleDetection/deploy/pptracking/python/mot/mtmct/postprocess.py
imports: import os
  import re
  import cv2
  from tqdm import tqdm
  import numpy
  from functools import reduce
  from .utils import parse_pt_gt, parse_pt, compare_dataframes_mtmc
  from .utils import get_labels, getData, gen_new_mot
  from .camera_utils import get_labels_with_camera
  from .zone import Zone
  from ..visualize import plot_tracking
label_desc: Use image node_id 5 for calling a global function with example usage: get_mtmct_matching_results(pred_mtmct_file, secs_interval, video_fps) and returns: camera_results,  cid_tid_fid_results, None,  None