code: def get_3d_bounding_box_iou(box1, box2):
      """Computes intersection between two given 3d bounding boxes.
  
      Args:
        box1: Input tensor with shape [B, 7] where the inner dimensions are as
              follows:[x, y, z, length, width, height, yaw].
        box2: Input tensor with shape [B, 7] where the inner dimensions are as
              follows:[x, y, z, length, width, height, yaw].
  
      Returns:
        The IoU between the two bounding boxes.
      """
      box1 = box1.numpy() if isinstance(box1, tf.Tensor) else box1
      box2 = box2.numpy() if isinstance(box2, tf.Tensor) else box2
  
      box1 = box1.astype(np.float32)
      box2 = box2.astype(np.float32)
  
      # rotates around z, while we rotate around y so need to swap
      center_1 = tf.reshape(box1[0:3][[0, 2, 1]], [1, 3])
      center_2 = tf.reshape(box2[0:3][[0, 2, 1]], [1, 3])
  
      rotation_z_1 = tf.reshape(box1[-1], [1])
      rotation_z_2 = tf.reshape(box2[-1], [1])
  
      length_1 = tf.reshape(box1[3 + 0], [1])
      height_1 = tf.reshape(box1[3 + 2], [1])
      width_1 = tf.reshape(box1[3 + 1], [1])
  
      length_2 = tf.reshape(box2[3 + 0], [1])
      height_2 = tf.reshape(box2[3 + 2], [1])
      width_2 = tf.reshape(box2[3 + 1], [1])
  
      iou = np.squeeze(
          np_box_ops.iou3d_7dof_box(
              length_1,
              height_1,
              width_1,
              center_1,
              rotation_z_1,
              length_2,
              height_2,
              width_2,
              center_2,
              rotation_z_2,
          )
      )
  
      return iou
  
imports: import os
  import pickle
  from absl import logging
  import matplotlib.pyplot
  import numpy
  import tensorflow
  from tensorflow_graphics.geometry.representation import grid
  from tensorflow_graphics.math.interpolation import trilinear
  from tensorflow_graphics.projects.points_to_3Dobjects.models import centernet_utils
  from tensorflow_graphics.projects.points_to_3Dobjects.utils import tf_utils
  from google3.pyglib import gfile
  from google3.third_party.google_research.google_research.tf3d.object_detection.box_utils import np_box_ops
label_desc: Use image node_id 2 for calling a global function with example usage: get_3d_bounding_box_iou(box1, box2) and returns: iou