code: def compute_pro(
      y_true: np.ndarray, amaps: np.ndarray, steps=500
  ) -> float:
      y_true = y_true.squeeze()
  
      pros = []
      fprs = []
      for th in tqdm(
          get_thresholds(amaps, steps, True, True)
      ):  # thresholds[::-1]:#
          binary_amaps = amaps.squeeze() > th
          """
          pro = []
          for binary_amap, mask in zip(binary_amaps, masks):
              for region in measure.regionprops(measure.label(mask)):
                  axes0_ids = region.coords[:, 0]
                  axes1_ids = region.coords[:, 1]
                  TP_pixels = binary_amap[axes0_ids, axes1_ids].sum()
                  pro.append(TP_pixels / region.area)
          pros.append(np.mean(pro))"""
          pros.append(compute_pro_(y_true, binary_amaps, "mean"))
  
          inverse_masks = 1 - y_true
          FP_pixels = np.logical_and(inverse_masks, binary_amaps).sum()
          fpr = FP_pixels / inverse_masks.sum()
          fprs.append(fpr)
          if fpr > 0.3:
              break
  
      # print(np.array(list(zip(pros,fprs))))
      fprs = np.array(fprs)
      pros = np.array(pros)
      return fprs, pros
  
imports: import os
  import argparse
  import numpy
  import matplotlib
  import matplotlib.pyplot
  from sklearn.metrics import roc_curve, auc
  from tqdm import tqdm
  from skimage import measure, morphology
  from skimage.segmentation import mark_boundaries
  import paddle
label_desc: Use image node_id 12 for calling a global function with example usage: compute_pro(y_true, amaps, steps) and returns: fprs,  pros