code: def bbox_xyxy_to_xywh(xyxy):
      """Convert bounding boxes from format (xmin, ymin, xmax, ymax) to (x, y, w, h).
  
      Parameters
      ----------
      xyxy : list, tuple or numpy.ndarray
          The bbox in format (xmin, ymin, xmax, ymax).
          If numpy.ndarray is provided, we expect multiple bounding boxes with
          shape `(N, 4)`.
  
      Returns
      -------
      tuple or numpy.ndarray
          The converted bboxes in format (x, y, w, h).
          If input is numpy.ndarray, return is numpy.ndarray correspondingly.
  
      """
      if isinstance(xyxy, (tuple, list)):
          if not len(xyxy) == 4:
              raise IndexError(
                  "Bounding boxes must have 4 elements, given {}".format(
                      len(xyxy)
                  )
              )
          x1, y1 = xyxy[0], xyxy[1]
          w, h = xyxy[2] - x1 + 1, xyxy[3] - y1 + 1
          return x1, y1, w, h
      elif isinstance(xyxy, np.ndarray):
          if not xyxy.size % 4 == 0:
              raise IndexError(
                  "Bounding boxes must have n * 4 elements, given {}".format(
                      xyxy.shape
                  )
              )
          return np.hstack(
              (xyxy[:, :2], xyxy[:, 2:4] - xyxy[:, :2] + 1)
          )
      else:
          raise TypeError(
              "Expect input xywh a list, tuple or numpy.ndarray, given {}".format(
                  type(xyxy)
              )
          )
  
imports: from __future__ import division
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: bbox_xyxy_to_xywh(xyxy) and returns: x1,  y1,  w,  h, np