code: def __bbox_overlap(a, b):
      x1 = torch.max(a[:, 0], b[0])
      y1 = torch.max(a[:, 1], b[1])
      x2 = torch.min(a[:, 2], b[2])
      y2 = torch.min(a[:, 3], b[3])
      w = x2 - x1 + 1
      h = y2 - y1 + 1
      inter = w * h
      aarea = (a[:, 2] - a[:, 0] + 1) * (a[:, 3] - a[:, 1] + 1)
      barea = (b[2] - b[0] + 1) * (b[3] - b[1] + 1)
      o = inter / (aarea + barea - inter)
      o[w <= 0] = 0
      o[h <= 0] = 0
      return o
  
imports: from __future__ import absolute_import
  import os
  import tqdm
  import pickle
  import datetime
  import argparse
  import numpy
  from scipy.io import loadmat
label_desc: Use image node_id 3 for calling a global function with example usage: __bbox_overlap(a, b) and returns: o