code: def iou_xyah(detected_pose, tracked_pose):
      height = tracked_pose.estimate[1, 1]
      width = tracked_pose.estimate[1, 0] * height
      area_tracked_pose = height * width
      half_size = np.array([width, height]) / 2
  
      top_left_corner_tracked_pose = (
          tracked_pose.estimate[0] - half_size
      )
      bottom_right_corner_tracked_pose = (
          tracked_pose.estimate[0] + half_size
      )
  
      height = detected_pose.points[1, 1]
      width = detected_pose.points[1, 0] * height
      area_detected_pose = height * width
      half_size = np.array([width, height]) / 2
  
      top_left_corner_detected_pose = (
          detected_pose.points[0] - half_size
      )
      bottom_right_corner_detected_pose = (
          detected_pose.points[0] + half_size
      )
  
      intersection = max(
          min(
              bottom_right_corner_detected_pose[1],
              bottom_right_corner_tracked_pose[1],
          )
          - max(
              top_left_corner_tracked_pose[1],
              top_left_corner_detected_pose[1],
          ),
          0,
      ) * max(
          min(
              bottom_right_corner_detected_pose[0],
              bottom_right_corner_tracked_pose[0],
          )
          - max(
              top_left_corner_tracked_pose[0],
              top_left_corner_detected_pose[0],
          ),
          0,
      )
      union = area_detected_pose + area_tracked_pose - intersection
  
      return 1 - intersection / union
  
file_path: norfair/demos/motmetrics4norfair/src/motmetrics4norfair_xyah.py
imports: import argparse
  import os.path
  import numpy
  from norfair import Detection, Tracker, drawing, metrics, video
  from norfair.filter import FilterPyKalmanFilterFactory
label_desc: Use image node_id 1 for calling a global function with example usage: iou_xyah(detected_pose, tracked_pose) and returns: unknown