from typing import List


def convert_coordinate(size: tuple, box: List) -> tuple:
    """Convert coordinate from xywh to
        x_center, y_center, width, height

    Arguments: \n
    `size` (tuple): size of image \n
    `box` (List): box coordinate \n

    Returns:\n
    `tuple`: new yolo coordinate
    """
    dw = 1.0 / size[0]
    dh = 1.0 / size[1]
    w = box[2]
    h = box[3]
    x = box[0] + box[2] / 2.0
    y = box[1] + box[3] / 2.0
    x = round(x * dw, 6)
    w = round(w * dw, 6)
    y = round(y * dh, 6)
    h = round(h * dh, 6)
    return (x, y, w, h)