code: def matchGtWithPreds(
      prediction_list: list,
      groundtruth_list: list,
      gt_instances: dict,
      args: CArgs,
      backend_args=None,
  ):
      """A wrapper of obj:``cityscapesscripts.evaluation.
  
      evalInstanceLevelSemanticLabeling.matchGtWithPreds``. Support loading
      groundtruth image from file backend.
      Args:
          prediction_list (list): A list of prediction txt file.
          groundtruth_list (list): A list of groundtruth image file.
          gt_instances (dict): Groundtruth dict.
          args (CArgs): A global object setting in
              obj:``cityscapesscripts.evaluation.
              evalInstanceLevelSemanticLabeling``
          backend_args (dict, optional): Arguments to instantiate the
              preifx of uri corresponding backend. Defaults to None.
      Returns:
          dict: The processed prediction and groundtruth result.
      """
      if not HAS_CITYSCAPESAPI:
          raise RuntimeError(
              "Failed to import `cityscapesscripts`."
              "Please try to install official "
              "cityscapesscripts by "
              '"pip install cityscapesscripts"'
          )
      matches: dict = dict()
      if not args.quiet:
          print(f"Matching {len(prediction_list)} pairs of images...")
  
      count = 0
      for pred, gt in zip(prediction_list, groundtruth_list):
          # Read input files
          gt_image = readGTImage(gt, backend_args)
          pred_info = readPredInfo(pred)
          # Get and filter ground truth instances
          unfiltered_instances = gt_instances[gt]
          cur_gt_instances_orig = CSEval.filterGtInstances(
              unfiltered_instances, args
          )
  
          # Try to assign all predictions
          (
              cur_gt_instances,
              cur_pred_instances,
          ) = CSEval.assignGt2Preds(
              cur_gt_instances_orig, gt_image, pred_info, args
          )
  
          # append to global dict
          matches[gt] = {}
          matches[gt]["groundTruth"] = cur_gt_instances
          matches[gt]["prediction"] = cur_pred_instances
  
          count += 1
          if not args.quiet:
              print(f"\rImages Processed: {count}", end=" ")
              sys.stdout.flush()
  
      if not args.quiet:
          print("")
  
      return matches
  
file_path: mmdetection/mmdet/evaluation/functional/cityscapes_utils.py
imports: import json
  import os
  import sys
  from pathlib import Path
  from typing import Optional, Union
  import mmcv
  import numpy
  from mmengine.fileio import get
label_desc: Use image node_id 2 for calling a global function with example usage: matchGtWithPreds(prediction_list, groundtruth_list, gt_instances, args, backend_args) and returns: matches