code: def iou_batch(bboxes1, bboxes2):
      bboxes2 = np.expand_dims(bboxes2, 0)
      bboxes1 = np.expand_dims(bboxes1, 1)
  
      xx1 = np.maximum(bboxes1[..., 0], bboxes2[..., 0])
      yy1 = np.maximum(bboxes1[..., 1], bboxes2[..., 1])
      xx2 = np.minimum(bboxes1[..., 2], bboxes2[..., 2])
      yy2 = np.minimum(bboxes1[..., 3], bboxes2[..., 3])
      w = np.maximum(0.0, xx2 - xx1)
      h = np.maximum(0.0, yy2 - yy1)
      area = w * h
      iou_matrix = area / (
          (bboxes1[..., 2] - bboxes1[..., 0])
          * (bboxes1[..., 3] - bboxes1[..., 1])
          + (bboxes2[..., 2] - bboxes2[..., 0])
          * (bboxes2[..., 3] - bboxes2[..., 1])
          - area
      )
      return iou_matrix
  
imports: import os
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: iou_batch(bboxes1, bboxes2) and returns: iou_matrix