code: def corner2center(corner):
      """
      convert (x1, y1, x2, y2) to (cx, cy, w, h)
  
      Parameters
      ----------
          conrner: list or np.ndarray
              Corner lefttop and rightdown location
  
      Return:
          Center location weight and height
      """
      if isinstance(corner, Corner):
          x_min, y_min, x_max, y_max = corner
          return Center(
              (x_min + x_max) * 0.5,
              (y_min + y_max) * 0.5,
              (x_max - x_min),
              (y_max - y_min),
          )
      else:
          x_min, y_min, x_max, y_max = (
              corner[0],
              corner[1],
              corner[2],
              corner[3],
          )
          center_x = (x_min + x_max) * 0.5
          center_y = (y_min + y_max) * 0.5
          bbox_w = x_max - x_min
          bbox_h = y_max - y_min
          return center_x, center_y, bbox_w, bbox_h
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import math
  from collections import namedtuple
  import numpy
  import mxnet
  from mxnet import nd
  from gluoncv.utils.filesystem import try_import_cv2
label_desc: Use image node_id 2 for calling a global function with example usage: corner2center(corner) and returns: Center, center_x,  center_y,  bbox_w,  bbox_h