code: def corners_to_boxes(corners3d):
      """
          7 -------- 4
         /|         /|
        6 -------- 5 .
        | |        | |
        . 3 -------- 0
        |/         |/
        2 -------- 1
      Args:
          corners: (N, 8, 3), vertex order shown in figure above
  
      Returns:
          boxes3d:  (N, 7) [x, y, z, dx, dy, dz, heading]
              with (x, y, z) is the box center
              (dx, dy, dz) as the box size
              and heading as the clockwise rotation angle
      """
  
      boxes3d = np.zeros((corners3d.shape[0], 7))
      for i in range(corners3d.shape[0]):
          boxes3d[i, :3] = np.mean(corners3d[i, :, :], axis=0)
          boxes3d[i, 3:6] = get_size(corners3d[i, :, :])
          boxes3d[i, 6] = get_heading_angle(corners3d[i, :, :])
  
      return boxes3d
  
file_path: ARKitScenes/threedod/benchmark_scripts/utils/box_utils.py
imports: import numpy
  import scipy.spatial
  from .rotation import rotate_points_along_z
label_desc: Use image node_id 4 for calling a global function with example usage: corners_to_boxes(corners3d) and returns: boxes3d