code: def IOU(Reframe, GTframe):
      x1 = Reframe[0]
      y1 = Reframe[1]
      width1 = Reframe[2] - Reframe[0]
      height1 = Reframe[3] - Reframe[1]
  
      x2 = GTframe[0]
      y2 = GTframe[1]
      width2 = GTframe[2] - GTframe[0]
      height2 = GTframe[3] - GTframe[1]
  
      endx = max(x1 + width1, x2 + width2)
      startx = min(x1, x2)
      width = width1 + width2 - (endx - startx)
  
      endy = max(y1 + height1, y2 + height2)
      starty = min(y1, y2)
      height = height1 + height2 - (endy - starty)
  
      if width <= 0 or height <= 0:
          ratio = 0
      else:
          Area = width * height
          Area1 = width1 * height1
          Area2 = width2 * height2
          ratio = Area * 1.0 / (Area1 + Area2 - Area)
      return ratio
  
file_path: insightface/recognition/subcenter_arcface/common/build_eval_pack.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import cv2
  import pickle
  import numpy
  import sys
  import os
  import face_align
  from retinaface import RetinaFace
label_desc: Use image node_id 2 for calling a global function with example usage: IOU(Reframe, GTframe) and returns: ratio