code: def plot_dir_far_cmc_scores(scores, names=None):
      try:
          import matplotlib.pyplot as plt
  
          fig = plt.figure()
          for id, score in enumerate(scores):
              name = None if names is None else names[id]
              if isinstance(score, str) and score.endswith(".npz"):
                  aa = np.load(score)
                  score, name = aa.get("scores")[0], aa.get("names")[0]
              fars, tpirs = score[0], score[1]
              name = name if name is not None else str(id)
  
              auc_value = auc(fars, tpirs)
              label = "[%s (AUC = %0.4f%%)]" % (name, auc_value * 100)
              plt.plot(fars, tpirs, lw=1, label=label)
  
          plt.xlabel("False Alarm Rate")
          plt.xlim([0.0001, 1])
          plt.xscale("log")
          plt.ylabel("Detection & Identification Rate (%)")
          plt.ylim([0, 1])
  
          plt.grid(linestyle="--", linewidth=1)
          plt.legend(fontsize="x-small")
          plt.tight_layout()
          plt.show()
      except:
          print("matplotlib plot failed")
          fig = None
  
      return fig
  
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 12 for calling a global function with example usage: plot_dir_far_cmc_scores(scores, names) and returns: fig