@numba.jit(nopython=True)
def box2d_to_corner_jit(boxes):
    num_box = boxes.shape[0]
    corners_norm = np.zeros((4, 2), dtype=boxes.dtype)
    corners_norm[(1, 1)] = 1.0
    corners_norm[2] = 1.0
    corners_norm[(3, 0)] = 1.0
    corners_norm -= np.array([0.5, 0.5], dtype=boxes.dtype)
    corners = (boxes.reshape(num_box, 1, 5)[:, :, 2:4] * corners_norm.reshape(1, 4, 2))
    rot_mat_T = np.zeros((2, 2), dtype=boxes.dtype)
    box_corners = np.zeros((num_box, 4, 2), dtype=boxes.dtype)
    for i in range(num_box):
        rot_sin = np.sin(boxes[(i, (- 1))])
        rot_cos = np.cos(boxes[(i, (- 1))])
        rot_mat_T[(0, 0)] = rot_cos
        rot_mat_T[(0, 1)] = (- rot_sin)
        rot_mat_T[(1, 0)] = rot_sin
        rot_mat_T[(1, 1)] = rot_cos
        box_corners[i] = ((corners[i] @ rot_mat_T) + boxes[i, :2])
    return box_corners
@numba.jit(nopython=True)
def box2d_to_corner_jit(boxes):
    num_box = boxes.shape[0]
    corners_norm = np.zeros((4, 2), dtype=boxes.dtype)
    corners_norm[(1, 1)] = 1.0
    corners_norm[2] = 1.0
    corners_norm[(3, 0)] = 1.0
    corners_norm -= np.array([0.5, 0.5], dtype=boxes.dtype)
    corners = (boxes.reshape(num_box, 1, 5)[:, :, 2:4] * corners_norm.reshape(1, 4, 2))
    rot_mat_T = np.zeros((2, 2), dtype=boxes.dtype)
    box_corners = np.zeros((num_box, 4, 2), dtype=boxes.dtype)
    for i in range(num_box):
        rot_sin = np.sin(boxes[(i, (- 1))])
        rot_cos = np.cos(boxes[(i, (- 1))])
        rot_mat_T[(0, 0)] = rot_cos
        rot_mat_T[(0, 1)] = (- rot_sin)
        rot_mat_T[(1, 0)] = rot_sin
        rot_mat_T[(1, 1)] = rot_cos
        box_corners[i] = ((corners[i] @ rot_mat_T) + boxes[i, :2])
    return box_corners