code: def iou(gt, pred):
      gt[gt > 0] = 1.0
      pred[pred > 0] = 1.0
      intersection = gt * pred
      union = gt + pred
      union[union > 0] = 1.0
      intersection = np.sum(intersection)
      union = np.sum(union)
      if union == 0:
          union = 1e-09
      return intersection / union
  
file_path: nni/examples/trials/kaggle-tgs-salt/metrics.py
imports: import numpy
  from pycocotools import mask
  from utils import get_segmentations
label_desc: Use image node_id 1 for calling a global function with example usage: iou(gt, pred) and returns: unknown