code: def box_ioa(boxes_1: np.ndarray, boxes_2: np.ndarray) -> np.ndarray:
      """Computes the IoA (intersection over area) between two sets of bounding boxes:
      ioa(i, j) = inter(i, j) / area(i)
  
      Args:
      ----
          boxes_1: bounding boxes of shape (N, 4) in format (xmin, ymin, xmax, ymax)
          boxes_2: bounding boxes of shape (M, 4) in format (xmin, ymin, xmax, ymax)
  
      Returns:
      -------
          the IoA matrix of shape (N, M)
      """
      ioa_mat: np.ndarray = np.zeros(
          (boxes_1.shape[0], boxes_2.shape[0]), dtype=np.float32
      )
  
      if boxes_1.shape[0] > 0 and boxes_2.shape[0] > 0:
          l1, t1, r1, b1 = np.split(boxes_1, 4, axis=1)
          l2, t2, r2, b2 = np.split(boxes_2, 4, axis=1)
  
          left = np.maximum(l1, l2.T)
          top = np.maximum(t1, t2.T)
          right = np.minimum(r1, r2.T)
          bot = np.minimum(b1, b2.T)
  
          intersection = np.clip(right - left, 0, np.Inf) * np.clip(
              bot - top, 0, np.Inf
          )
          area = (r1 - l1) * (b1 - t1)
          ioa_mat = intersection / area
  
      return ioa_mat
  
imports: from typing import Dict, List, Optional, Tuple
  import cv2
  import numpy
  from scipy.optimize import linear_sum_assignment
  from unidecode import unidecode
label_desc: Use image node_id 3 for calling a global function with example usage: box_ioa(boxes_1, boxes_2) and returns: ioa_mat