code: def _box_inter_union(
      boxes1: np.array, boxes2: np.array
  ) -> Tuple[np.array, np.array]:
      area1 = box_area(boxes1)
      area2 = box_area(boxes2)
  
      lt = np.maximum(boxes1[:, None, :2], boxes2[:, :2])  # [N,M,2]
      rb = np.minimum(boxes1[:, None, 2:], boxes2[:, 2:])  # [N,M,2]
  
      wh = (rb - lt).clip(min=0)  # [N,M,2]
      inter = wh[:, :, 0] * wh[:, :, 1]  # [N,M]
  
      union = area1[:, None] + area2 - inter
  
      return inter, union
  
imports: import xml.etree.ElementTree
  from collections import defaultdict
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
  import numpy
  from prettytable import PrettyTable
  from tqdm import tqdm
  import json
  import os
  import re
label_desc: Use image node_id 7 for calling a global function with example usage: _box_inter_union(boxes1, boxes2) and returns: inter,  union