def _whctrs(anchor):
    """
    Return width, height, x center, and y center for an anchor (window).
    """

    width = anchor[2] - anchor[0] + 1
    height = anchor[3] - anchor[1] + 1
    x_ctr = anchor[0] + 0.5 * (width - 1)
    y_ctr = anchor[1] + 0.5 * (height - 1)
    return width, height, x_ctr, y_ctr
Return width, height, x center, and y center for an anchor (window).
python/aitemplate/frontend/nn/proposal.py