def _ConvertBoxToCOCOFormat(box):
    'Converts a box in [ymin, xmin, ymax, xmax] format to COCO format.\n\n  This is a utility function for converting from our internal\n  [ymin, xmin, ymax, xmax] convention to the convention used by the COCO API\n  i.e., [xmin, ymin, width, height].\n\n  Args:\n    box: a [ymin, xmin, ymax, xmax] numpy array\n\n  Returns:\n    a list of floats representing [xmin, ymin, width, height]\n  '
    return [float(box[1]), float(box[0]), float((box[3] - box[1])), float((box[2] - box[0]))]
Converts a box in [ymin, xmin, ymax, xmax] format to COCO format.

This is a utility function for converting from our internal
[ymin, xmin, ymax, xmax] convention to the convention used by the COCO API
i.e., [xmin, ymin, width, height].

Args:
  box: a [ymin, xmin, ymax, xmax] numpy array

Returns:
  a list of floats representing [xmin, ymin, width, height]
def _ConvertBoxToCOCOFormat(box):
    'Converts a box in [ymin, xmin, ymax, xmax] format to COCO format.\n\n  This is a utility function for converting from our internal\n  [ymin, xmin, ymax, xmax] convention to the convention used by the COCO API\n  i.e., [xmin, ymin, width, height].\n\n  Args:\n    box: a [ymin, xmin, ymax, xmax] numpy array\n\n  Returns:\n    a list of floats representing [xmin, ymin, width, height]\n  '
    return [float(box[1]), float(box[0]), float((box[3] - box[1])), float((box[2] - box[0]))]