code: def wider_evaluation(pred, gt_path, iou_thresh=0.5, debug=False):
      # pred = get_preds(pred)
      pred = norm_score(pred)
      thresh_num = 1000
      # thresh_num = 2000
      (
          facebox_list,
          event_list,
          file_list,
          hard_gt_list,
          medium_gt_list,
          easy_gt_list,
      ) = get_gt_boxes(gt_path)
      event_num = len(event_list)
      settings = ["easy", "medium", "hard"]
      setting_gts = [easy_gt_list, medium_gt_list, hard_gt_list]
      from multiprocessing import Pool
  
      # from multiprocessing.pool import ThreadPool
      mpp = Pool(8)
      aps = [-1.0, -1.0, -1.0]
      meta = {}
      # setting_id = 2
      print("")
      for setting_id in range(3):
          # for setting_id in range(1):
          ta = datetime.datetime.now()
          # different setting
          # iou_th = 0.5 #+ 0.05 * idx
          iou_th = iou_thresh
          # different setting
          gt_list = setting_gts[setting_id]
          count_face = 0
          pr_curve = np.zeros((thresh_num, 2)).astype("float")
          # [hard, medium, easy]
          # pbar = tqdm.tqdm(range(event_num))
          # for i in pbar:
          high_score_count = 0
          high_score_fp_count = 0
          for i in range(event_num):
              # pbar.set_description('Processing {}'.format(settings[setting_id]))
              event_name = str(event_list[i][0][0])
              img_list = file_list[i][0]
              pred_list = pred[event_name]
              sub_gt_list = gt_list[i][0]
              # img_pr_info_list = np.zeros((len(img_list), thresh_num, 2))
              gt_bbx_list = facebox_list[i][0]
  
              for j in range(len(img_list)):
                  img_name = str(img_list[j][0][0])
                  pred_info = pred_list[img_name]
  
                  gt_boxes = gt_bbx_list[j][0].astype("float")
                  keep_index = sub_gt_list[j][0]
                  # print ('keep_index', keep_index)
                  count_face += len(keep_index)
  
                  if len(gt_boxes) == 0 or len(pred_info) == 0:
                      continue
                  # ignore = np.zeros(gt_boxes.shape[0])
                  # if len(keep_index) != 0:
                  #    ignore[keep_index-1] = 1
                  # assert len(keep_index)>0
                  ignore = np.zeros(gt_boxes.shape[0], dtype=np.int)
                  if len(keep_index) != 0:
                      ignore[keep_index - 1] = 1
                  pred_info = np_round(pred_info, 1)
                  # print('ignore:', len(ignore), len(np.where(ignore==1)[0]))
                  # pred_sort_idx= np.argsort(pred_info[:,4])
                  # pred_info = pred_info[pred_sort_idx][::-1]
                  # print ('pred_info', pred_info[:20, 4])
                  # exit()
  
                  gt_boxes = np_round(gt_boxes)
                  # ignore = np_round(ignore)
                  pred_recall, proposal_list = image_eval(
                      pred_info, gt_boxes, ignore, iou_th, mpp
                  )
                  # print(pred_recall[:10], proposal_list[:10])
                  # print('1 stage', pred_recall, proposal_list)
                  # print(pred_info.shape, pred_recall.shape)
  
                  _img_pr_info, fp = img_pr_info(
                      thresh_num, pred_info, proposal_list, pred_recall
                  )
                  # for f in range(pred_info.shape[0]):
                  #    _score = pred_info[f,4]
                  #    if _score<0.929:
                  #        break
                  #    high_score_count+=1
                  #    if fp[f]==1:
                  #        w = pred_info[f, 2]
                  #        h = pred_info[f, 3]
                  #        print('fp:', event_name, img_name, _score, w, h)
                  #        high_score_fp_count+=1
                  pr_curve += _img_pr_info
          # print ('pr_curve', pr_curve, count_face)
          pr_curve = dataset_pr_info(thresh_num, pr_curve, count_face)
          # print(pr_curve.shape)
  
          propose = pr_curve[:, 0]
          recall = pr_curve[:, 1]
          # for f in range(thresh_num):
          #    print('R-P:', recall[f], propose[f])
          for srecall in np.arange(0.1, 1.0001, 0.1):
              rindex = len(np.where(recall <= srecall)[0]) - 1
              rthresh = 1.0 - float(rindex) / thresh_num
              print(
                  "Recall-Precision-Thresh:",
                  recall[rindex],
                  propose[rindex],
                  rthresh,
              )
  
          ap = voc_ap(recall, propose)
          aps[setting_id] = ap
          tb = datetime.datetime.now()
          # print('high score count:', high_score_count)
          # print('high score fp count:', high_score_fp_count)
          print(
              "%s cost %.4f seconds, ap: %.5f"
              % (settings[setting_id], (tb - ta).total_seconds(), ap)
          )
  
      return aps
  
imports: from __future__ import absolute_import
  import os
  import tqdm
  import pickle
  import datetime
  import argparse
  import numpy
  from scipy.io import loadmat
label_desc: Use image node_id 15 for calling a global function with example usage: wider_evaluation(pred, gt_path, iou_thresh, debug) and returns: aps