code: def pq_compute_multi_core(
      matched_annotations_list,
      gt_folder,
      pred_folder,
      categories,
      backend_args=None,
      nproc=32,
  ):
      """Evaluate the metrics of Panoptic Segmentation with multithreading.
  
      Same as the function with the same name in `panopticapi`.
  
      Args:
          matched_annotations_list (list): The matched annotation list. Each
              element is a tuple of annotations of the same image with the
              format (gt_anns, pred_anns).
          gt_folder (str): The path of the ground truth images.
          pred_folder (str): The path of the prediction images.
          categories (str): The categories of the dataset.
          backend_args (object): The file client of the dataset. If None,
              the backend will be set to `local`.
          nproc (int): Number of processes for panoptic quality computing.
              Defaults to 32. When `nproc` exceeds the number of cpu cores,
              the number of cpu cores is used.
      """
      if PQStat is None:
          raise RuntimeError(
              "panopticapi is not installed, please install it by: "
              "pip install git+https://github.com/cocodataset/"
              "panopticapi.git."
          )
  
      cpu_num = min(nproc, multiprocessing.cpu_count())
  
      annotations_split = np.array_split(
          matched_annotations_list, cpu_num
      )
      print(
          "Number of cores: {}, images per core: {}".format(
              cpu_num, len(annotations_split[0])
          )
      )
      workers = multiprocessing.Pool(processes=cpu_num)
      processes = []
      for proc_id, annotation_set in enumerate(annotations_split):
          p = workers.apply_async(
              pq_compute_single_core,
              (
                  proc_id,
                  annotation_set,
                  gt_folder,
                  pred_folder,
                  categories,
                  backend_args,
              ),
          )
          processes.append(p)
  
      # Close the process pool, otherwise it will lead to memory
      # leaking problems.
      workers.close()
      workers.join()
  
      pq_stat = PQStat()
      for p in processes:
          pq_stat += p.get()
  
      return pq_stat
  
imports: import multiprocessing
  import os
  import mmcv
  import numpy
  from mmengine.fileio import get
label_desc: Use image node_id 2 for calling a global function with example usage: pq_compute_multi_core(matched_annotations_list, gt_folder, pred_folder, categories, backend_args, nproc) and returns: pq_stat