code: def get_widerface_gts(gt_path):
      (
          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]
      all_results = []
      for setting_id in range(3):
          results = {}
          gt_list = setting_gts[setting_id]
          count_face = 0
          # [hard, medium, easy]
          # pbar = tqdm.tqdm(range(event_num))
          # for i in pbar:
          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]
              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]
              results[event_name] = {}
  
              for j in range(len(img_list)):
                  gt_boxes = gt_bbx_list[j][0].astype("float").copy()
                  gt_boxes[:, 2] += gt_boxes[:, 0]
                  gt_boxes[:, 3] += gt_boxes[:, 1]
                  keep_index = sub_gt_list[j][0].copy()
                  # print ('keep_index', keep_index.shape)
                  count_face += len(keep_index)
  
                  if len(gt_boxes) == 0:
                      results[event_name][
                          str(img_list[j][0][0])
                      ] = np.empty((0, 4))
                      continue
                  keep_index -= 1
                  keep_index = keep_index.flatten()
                  # 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
                  # 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()
                  # if setting_id==2 and len(keep_index)<gt_boxes.shape[0]:
                  #    print(gt_boxes.shape, keep_index.shape)
  
                  gt_boxes = np_round(gt_boxes)[keep_index, :]
  
                  results[event_name][str(img_list[j][0][0])] = gt_boxes
          all_results.append(results)
      return all_results
  
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 16 for calling a global function with example usage: get_widerface_gts(gt_path) and returns: all_results