code: def cal_metric(predict_dir, gt_dir, num_classes, key_list):
      predict_list = glob.glob(predict_dir)
      pred_metics = {}
      for predict_dir_ in predict_list:
          key = os.path.basename(predict_dir_)
          print(key)
          pred_dict = evaluate(predict_dir_, gt_dir, num_classes)
          pred_metics[key] = pred_dict
      return pred_metics
  
file_path: PaddleSeg/test_tipc/compare_results.py
imports: import numpy
  import os
  import subprocess
  import json
  import argparse
  import glob
  from val import evaluate
label_desc: Use image node_id 6 for calling a global function with example usage: cal_metric(predict_dir, gt_dir, num_classes, key_list) and returns: pred_metics