code: def compute_precision_recall_f1(count_metrics):
      tp = count_metrics["TP"]
      fp = count_metrics["FP"]
      fn = count_metrics["FN"]
      precision = 0.0 if tp == 0 else float(tp) / float(tp + fp)
      recall = 0.0 if tp == 0 else float(tp) / float(tp + fn)
      if precision == 0.0 or recall == 0.0:
          f1 = 0.0
      else:
          f1 = 2 * (precision * recall) / (precision + recall)
      return f1
  
label_desc: Use image node_id 1 for calling a global function with example usage: compute_precision_recall_f1(count_metrics) and returns: f1