def get_bbox(img, bbox):
    """
    API expects bbox as [ymin, xmin, ymax, xmax], in relative values,
    convert to tuple (xmin, ymin, xmax, ymax), in pixel values
    """
    width, height = img.size
    bbox_px = (0, 0, width, height)
    if bbox:
        bbox_px = (
          int(bbox[1] * width),
          int(bbox[0] * height),
          int(bbox[3] * width),
          int(bbox[2] * height)
        )
    return bbox_px