def voc2yolo(image_height, image_width, bboxes):
    '\n    voc  => [x1, y1, x2, y1]\n    yolo => [xmid, ymid, w, h] (normalized)\n    '
    bboxes = bboxes.copy().astype(float)
    bboxes[(..., [0, 2])] = (bboxes[(..., [0, 2])] / image_width)
    bboxes[(..., [1, 3])] = (bboxes[(..., [1, 3])] / image_height)
    w = (bboxes[(..., 2)] - bboxes[(..., 0)])
    h = (bboxes[(..., 3)] - bboxes[(..., 1)])
    bboxes[(..., 0)] = (bboxes[(..., 0)] + (w / 2))
    bboxes[(..., 1)] = (bboxes[(..., 1)] + (h / 2))
    bboxes[(..., 2)] = w
    bboxes[(..., 3)] = h
    return bboxes
voc  => [x1, y1, x2, y1]
yolo => [xmid, ymid, w, h] (normalized)
def voc2yolo(image_height, image_width, bboxes):
    '\n    voc  => [x1, y1, x2, y1]\n    yolo => [xmid, ymid, w, h] (normalized)\n    '
    bboxes = bboxes.copy().astype(float)
    bboxes[(..., [0, 2])] = (bboxes[(..., [0, 2])] / image_width)
    bboxes[(..., [1, 3])] = (bboxes[(..., [1, 3])] / image_height)
    w = (bboxes[(..., 2)] - bboxes[(..., 0)])
    h = (bboxes[(..., 3)] - bboxes[(..., 1)])
    bboxes[(..., 0)] = (bboxes[(..., 0)] + (w / 2))
    bboxes[(..., 1)] = (bboxes[(..., 1)] + (h / 2))
    bboxes[(..., 2)] = w
    bboxes[(..., 3)] = h
    return bboxes