@numba.jit(nopython=True)
def iou_3d_jit(boxes, query_boxes, add1=True):
    'calculate box iou3d,\n    ----------\n    boxes: (N, 6) ndarray of float\n    query_boxes: (K, 6) ndarray of float\n    Returns\n    -------\n    overlaps: (N, K) ndarray of overlap between boxes and query_boxes\n    '
    N = boxes.shape[0]
    K = query_boxes.shape[0]
    overlaps = np.zeros((N, K), dtype=boxes.dtype)
    if add1:
        add1 = 1.0
    else:
        add1 = 0.0
    for k in range(K):
        box_area = ((((query_boxes[(k, 3)] - query_boxes[(k, 0)]) + add1) * ((query_boxes[(k, 4)] - query_boxes[(k, 1)]) + add1)) * ((query_boxes[(k, 5)] - query_boxes[(k, 2)]) + add1))
        for n in range(N):
            iw = ((min(boxes[(n, 3)], query_boxes[(k, 3)]) - max(boxes[(n, 0)], query_boxes[(k, 0)])) + add1)
            if (iw > 0):
                ih = ((min(boxes[(n, 4)], query_boxes[(k, 4)]) - max(boxes[(n, 1)], query_boxes[(k, 1)])) + add1)
                if (ih > 0):
                    il = ((min(boxes[(n, 5)], query_boxes[(k, 5)]) - max(boxes[(n, 2)], query_boxes[(k, 2)])) + add1)
                    if (il > 0):
                        ua = float(((((((boxes[(n, 3)] - boxes[(n, 0)]) + add1) * ((boxes[(n, 4)] - boxes[(n, 1)]) + add1)) * ((boxes[(n, 5)] - boxes[(n, 2)]) + add1)) + box_area) - ((iw * ih) * il)))
                        overlaps[(n, k)] = (((iw * ih) * il) / ua)
    return overlaps
calculate box iou3d,
----------
boxes: (N, 6) ndarray of float
query_boxes: (K, 6) ndarray of float
Returns
-------
overlaps: (N, K) ndarray of overlap between boxes and query_boxes
@numba.jit(nopython=True)
def iou_3d_jit(boxes, query_boxes, add1=True):
    'calculate box iou3d,\n    ----------\n    boxes: (N, 6) ndarray of float\n    query_boxes: (K, 6) ndarray of float\n    Returns\n    -------\n    overlaps: (N, K) ndarray of overlap between boxes and query_boxes\n    '
    N = boxes.shape[0]
    K = query_boxes.shape[0]
    overlaps = np.zeros((N, K), dtype=boxes.dtype)
    if add1:
        add1 = 1.0
    else:
        add1 = 0.0
    for k in range(K):
        box_area = ((((query_boxes[(k, 3)] - query_boxes[(k, 0)]) + add1) * ((query_boxes[(k, 4)] - query_boxes[(k, 1)]) + add1)) * ((query_boxes[(k, 5)] - query_boxes[(k, 2)]) + add1))
        for n in range(N):
            iw = ((min(boxes[(n, 3)], query_boxes[(k, 3)]) - max(boxes[(n, 0)], query_boxes[(k, 0)])) + add1)
            if (iw > 0):
                ih = ((min(boxes[(n, 4)], query_boxes[(k, 4)]) - max(boxes[(n, 1)], query_boxes[(k, 1)])) + add1)
                if (ih > 0):
                    il = ((min(boxes[(n, 5)], query_boxes[(k, 5)]) - max(boxes[(n, 2)], query_boxes[(k, 2)])) + add1)
                    if (il > 0):
                        ua = float(((((((boxes[(n, 3)] - boxes[(n, 0)]) + add1) * ((boxes[(n, 4)] - boxes[(n, 1)]) + add1)) * ((boxes[(n, 5)] - boxes[(n, 2)]) + add1)) + box_area) - ((iw * ih) * il)))
                        overlaps[(n, k)] = (((iw * ih) * il) / ua)
    return overlaps