def yolo2coco(size, yolo):
    """convert yolo format to coco bbox

    Args:
        size (tuple): (width, height)
        yolo (tuple): (ratio-bbox-centre-x, ratio-bbox-centre-y, ratio-bbox-w, ratio-bbox-h)

    Rets:
        coco: xmin, ymin, boxw, boxh
    """
    width = size[0]
    height = size[1]

    centrex = yolo[0] * width
    centrey = yolo[1] * height
    boxw = yolo[2] * width
    boxh = yolo[3] * height

    halfw = boxw / 2
    halfh = boxh / 2

    xmin = centrex - halfw
    ymin = centrey - halfh

    coco = xmin, ymin, boxw, boxh
    return coco