code: def extract_gt(gt_fn):
      """extract original label data
  
      Args:
          gt_fn: str (file name of "annotation.json")
              after loading, we got a dict with keys
                  'data', 'stats', 'comment', 'confirm', 'skipped'
              ['data']: a list of dict for bboxes, each dict has keys:
                  'uid', 'label', 'modelId', 'children', 'objectId',
                  'segments', 'hierarchy', 'isInGroup', 'labelType', 'attributes'
                  'label': str
                  'segments': dict for boxes
                      'centroid': list of float (x, y, z)?
                      'axesLengths': list of float (x, y, z)?
                      'normalizedAxes': list of float len()=9
                  'uid'
              'comments':
              'stats': ...
      Returns:
          skipped: bool
              skipped or not
          boxes_corners: (n, 8, 3) box corners
              **world-coordinate**
          centers: (n, 3)
              **world-coordinate**
          sizes: (n, 3) full-sizes (no halving!)
          labels: list of str
          uids: list of str
      """
      gt = json.load(open(gt_fn, "r"))
      skipped = gt["skipped"]
      if len(gt) == 0:
          boxes_corners = np.zeros((0, 8, 3))
          centers = np.zeros((0, 3))
          sizes = np.zeros((0, 3))
          labels, uids = [], []
          return skipped, boxes_corners, centers, sizes, labels, uids
  
      boxes_corners = []
      centers = []
      sizes = []
      labels = []
      uids = []
      for data in gt["data"]:
          l = data["label"]
          for delimiter in [" ", "-", "/"]:
              l = l.replace(delimiter, "_")
          if l not in class_names:
              print("unknown category: %s" % l)
              continue
  
          rotmat = np.array(
              data["segments"]["obbAligned"]["normalizedAxes"]
          ).reshape(3, 3)
          center = np.array(
              data["segments"]["obbAligned"]["centroid"]
          ).reshape(-1, 3)
          size = np.array(
              data["segments"]["obbAligned"]["axesLengths"]
          ).reshape(-1, 3)
          box3d = compute_box_3d(
              size.reshape(3).tolist(), center, rotmat
          )
  
          """
              Box corner order that we return is of the format below:
                  6 -------- 7
                 /|         /|
                5 -------- 4 .
                | |        | |
                . 2 -------- 3
                |/         |/
                1 -------- 0 
          """
  
          boxes_corners.append(box3d.reshape(1, 8, 3))
          size = np.array(get_size(box3d)).reshape(1, 3)
          center = np.mean(box3d, axis=0).reshape(1, 3)
  
          # boxes_corners.append(box3d.reshape(1, 8, 3))
          centers.append(center)
          sizes.append(size)
          # labels.append(l)
          labels.append(data["label"])
          uids.append(data["uid"])
      centers = np.concatenate(centers, axis=0)
      sizes = np.concatenate(sizes, axis=0)
      boxes_corners = np.concatenate(boxes_corners, axis=0)
      return skipped, boxes_corners, centers, sizes, labels, uids
  
file_path: ARKitScenes/threedod/benchmark_scripts/utils/tenFpsDataLoader.py
imports: import copy
  import cv2
  import glob
  import json
  import numpy
  import os
  from .box_utils import compute_box_3d, boxes_to_corners_3d, get_size
  from .rotation import convert_angle_axis_to_matrix3
  from .taxonomy import class_names, ARKitDatasetConfig
label_desc: Use image node_id 4 for calling a global function with example usage: extract_gt(gt_fn) and returns: skipped,  boxes_corners,  centers,  sizes,  labels,  uids, skipped,  boxes_corners,  centers,  sizes,  labels,  uids