code: def save_mtmct_vis_results(
      camera_results, images_dir, save_dir, save_videos=False
  ):
      # camera_results: 'cid, tid, fid, x1, y1, w, h'
      camera_ids = camera_results.keys()
      seqs_folder = os.listdir(images_dir)
      seqs = []
      for x in seqs_folder:
          if os.path.isdir(os.path.join(images_dir, x)):
              seqs.append(x)
      assert len(seqs) == len(camera_ids)
      seqs.sort()
  
      if not os.path.exists(save_dir):
          os.makedirs(save_dir)
  
      for i, c_id in enumerate(camera_ids):
          print(
              "Start visualization for camera {} of sequence {}.".format(
                  c_id, seqs[i]
              )
          )
          cid_save_dir = os.path.join(save_dir, "{}".format(seqs[i]))
          if not os.path.exists(cid_save_dir):
              os.makedirs(cid_save_dir)
  
          infer_dir = os.path.join(images_dir, seqs[i])
          if os.path.exists(os.path.join(infer_dir, "img1")):
              infer_dir = os.path.join(infer_dir, "img1")
          all_images = os.listdir(infer_dir)
          all_images.sort()
  
          for f_id, im_path in enumerate(all_images):
              img = cv2.imread(os.path.join(infer_dir, im_path))
              tracks = camera_results[c_id][
                  camera_results[c_id][:, 2] == f_id
              ]
              if tracks.shape[0] > 0:
                  tracked_ids = tracks[:, 1]
                  xywhs = tracks[:, 3:]
                  online_im = plot_tracking(
                      img,
                      xywhs,
                      tracked_ids,
                      scores=None,
                      frame_id=f_id,
                  )
              else:
                  online_im = img
                  print(
                      "Frame {} of seq {} has no tracking results".format(
                          f_id, seqs[i]
                      )
                  )
  
              cv2.imwrite(
                  os.path.join(cid_save_dir, "{:05d}.jpg".format(f_id)),
                  online_im,
              )
              if f_id % 40 == 0:
                  print("Processing frame {}".format(f_id))
  
          if save_videos:
              output_video_path = os.path.join(
                  cid_save_dir, "..", "{}_mtmct_vis.mp4".format(seqs[i])
              )
              cmd_str = "ffmpeg -f image2 -i {}/%05d.jpg {}".format(
                  cid_save_dir, output_video_path
              )
              os.system(cmd_str)
              print(
                  "Save camera {} video in {}.".format(
                      seqs[i], output_video_path
                  )
              )
  
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 7 for calling a global function with example usage: save_mtmct_vis_results(camera_results, images_dir, save_dir, save_videos) without return types