code: def xyxy2xywh(bboxes):
      if len(bboxes.shape) == 1:
          new_bboxes = np.empty_like(bboxes)
          new_bboxes[0] = bboxes[0] + (bboxes[2] - bboxes[0]) / 2
          new_bboxes[1] = bboxes[1] + (bboxes[3] - bboxes[1]) / 2
          new_bboxes[2] = bboxes[2] - bboxes[0]
          new_bboxes[3] = bboxes[3] - bboxes[1]
          return new_bboxes
      elif len(bboxes.shape) == 2:
          new_bboxes = np.empty_like(bboxes)
          new_bboxes[:, 0] = (
              bboxes[:, 0] + (bboxes[:, 2] - bboxes[:, 0]) / 2
          )
          new_bboxes[:, 1] = (
              bboxes[:, 1] + (bboxes[:, 3] - bboxes[:, 1]) / 2
          )
          new_bboxes[:, 2] = bboxes[:, 2] - bboxes[:, 0]
          new_bboxes[:, 3] = bboxes[:, 3] - bboxes[:, 1]
          return new_bboxes
      else:
          raise ValueError
  
imports: import os
  import re
  import cv2
  import glob
  import copy
  import math
  import pickle
  import numpy
  from shapely.geometry import Polygon, MultiPoint
label_desc: Use image node_id 3 for calling a global function with example usage: xyxy2xywh(bboxes) and returns: new_bboxes, new_bboxes