code: def _transform_label(label, height=None, width=None):
      label = np.array(label).ravel()
      header_len = int(label[0])  # label header
      label_width = int(
          label[1]
      )  # the label width for each object, >= 5
      if label_width < 5:
          raise ValueError(
              "Label info for each object should >= 5, given {}".format(
                  label_width
              )
          )
      min_len = header_len + 5
      if len(label) < min_len:
          raise ValueError(
              "Expected label length >= {}, got {}".format(
                  min_len, len(label)
              )
          )
      if (len(label) - header_len) % label_width:
          raise ValueError(
              "Broken label of size {}, cannot reshape into (N, {}) "
              "if header length {} is excluded".format(
                  len(label), label_width, header_len
              )
          )
      gcv_label = label[header_len:].reshape(-1, label_width)
      # swap columns, gluon-cv requires [xmin-ymin-xmax-ymax-id-extra0-extra1-xxx]
      ids = gcv_label[:, 0].copy()
      gcv_label[:, :4] = gcv_label[:, 1:5]
      gcv_label[:, 4] = ids
      # restore to absolute coordinates
      if height is not None:
          gcv_label[:, (0, 2)] *= width
      if width is not None:
          gcv_label[:, (1, 3)] *= height
      return gcv_label
  
file_path: gluon-cv/gluoncv/data/recordio/detection.py
imports: from __future__ import absolute_import
  from __future__ import division
  import numpy
  from mxnet import gluon
label_desc: Use image node_id 1 for calling a global function with example usage: _transform_label(label, height, width) and returns: gcv_label