import tensorflow as tf

  """
  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

