code: def calculate_bbox_ios(
      pred1: ObjectPrediction, pred2: ObjectPrediction
  ) -> float:
      """Returns the ratio of intersection area to the smaller box's area"""
      box1 = np.array(pred1.bbox.to_xyxy())
      box2 = np.array(pred2.bbox.to_xyxy())
      area1 = calculate_area(box1)
      area2 = calculate_area(box2)
      intersect = calculate_intersection_area(box1, box2)
      smaller_area = np.minimum(area1, area2)
      return intersect / smaller_area
  
imports: from collections.abc import Sequence
  from typing import List, Union
  import numpy
  import torch
  from sahi.annotation import BoundingBox, Category, Mask
  from sahi.prediction import ObjectPrediction
label_desc: Use image node_id 7 for calling a global function with example usage: calculate_bbox_ios(pred1, pred2) and returns: unknown