code: def extract_gallery_prob_data(
      data_path, subset, save_path=None, force_reload=False
  ):
      if save_path == None:
          save_path = os.path.join(
              data_path, subset + "_gallery_prob_backup.npz"
          )
      if not force_reload and os.path.exists(save_path):
          print(">>>> Reload from backup: %s ..." % save_path)
          aa = np.load(save_path)
          return (
              aa["s1_templates"],
              aa["s1_subject_ids"],
              aa["s2_templates"],
              aa["s2_subject_ids"],
              aa["probe_mixed_templates"],
              aa["probe_mixed_subject_ids"],
          )
  
      if subset == "IJBC":
          meta_dir = os.path.join(data_path, "IJBC/meta")
          gallery_s1_record = os.path.join(
              meta_dir, "ijbc_1N_gallery_G1.csv"
          )
          gallery_s2_record = os.path.join(
              meta_dir, "ijbc_1N_gallery_G2.csv"
          )
          probe_mixed_record = os.path.join(
              meta_dir, "ijbc_1N_probe_mixed.csv"
          )
      else:
          meta_dir = os.path.join(data_path, "IJBB/meta")
          gallery_s1_record = os.path.join(
              meta_dir, "ijbb_1N_gallery_S1.csv"
          )
          gallery_s2_record = os.path.join(
              meta_dir, "ijbb_1N_gallery_S2.csv"
          )
          probe_mixed_record = os.path.join(
              meta_dir, "ijbb_1N_probe_mixed.csv"
          )
  
      print(">>>> Loading gallery feature...")
      s1_templates, s1_subject_ids = read_IJB_meta_columns_to_int(
          gallery_s1_record, columns=[0, 1], skiprows=1, sep=","
      )
      s2_templates, s2_subject_ids = read_IJB_meta_columns_to_int(
          gallery_s2_record, columns=[0, 1], skiprows=1, sep=","
      )
      print(
          "s1 gallery: %s, ids: %s, unique: %s"
          % (
              s1_templates.shape,
              s1_subject_ids.shape,
              np.unique(s1_templates).shape,
          )
      )
      print(
          "s2 gallery: %s, ids: %s, unique: %s"
          % (
              s2_templates.shape,
              s2_subject_ids.shape,
              np.unique(s2_templates).shape,
          )
      )
  
      print(">>>> Loading prope feature...")
      (
          probe_mixed_templates,
          probe_mixed_subject_ids,
      ) = read_IJB_meta_columns_to_int(
          probe_mixed_record, columns=[0, 1], skiprows=1, sep=","
      )
      print(
          "probe_mixed_templates: %s, unique: %s"
          % (
              probe_mixed_templates.shape,
              np.unique(probe_mixed_templates).shape,
          )
      )
      print(
          "probe_mixed_subject_ids: %s, unique: %s"
          % (
              probe_mixed_subject_ids.shape,
              np.unique(probe_mixed_subject_ids).shape,
          )
      )
  
      print(">>>> Saving backup to: %s ..." % save_path)
      np.savez(
          save_path,
          s1_templates=s1_templates,
          s1_subject_ids=s1_subject_ids,
          s2_templates=s2_templates,
          s2_subject_ids=s2_subject_ids,
          probe_mixed_templates=probe_mixed_templates,
          probe_mixed_subject_ids=probe_mixed_subject_ids,
      )
      print()
      return (
          s1_templates,
          s1_subject_ids,
          s2_templates,
          s2_subject_ids,
          probe_mixed_templates,
          probe_mixed_subject_ids,
      )
  
imports: import os
  import cv2
  import numpy
  import pandas
  from tqdm import tqdm
  from skimage import transform
  from sklearn.preprocessing import normalize
  from sklearn.metrics import roc_curve, auc
label_desc: Use image node_id 5 for calling a global function with example usage: extract_gallery_prob_data(data_path, subset, save_path, force_reload) and returns: s1_templates,  s1_subject_ids,  s2_templates,  s2_subject_ids,  probe_mixed_templates,  probe_mixed_subject_ids, aa,  aa,  aa,  aa,  aa,  aa