(box_encodings,
                   anchors,
                   encode_angle_to_vector=False,
                   smooth_dim=False)
return np.concatenate([xg, yg, wg, lg, rg], axis=-1)
box decode for VoxelNet in lidar
    Args:
        boxes ([N, 7] Tensor): normal boxes: x, y, z, w, l, h, r
        anchors ([N, 7] Tensor): anchors
box decode for VoxelNet in lidar
    Args:
        boxes ([N, 7] Tensor): normal boxes: x, y, z, w, l, h, r
        anchors ([N, 7] Tensor): anchors
box decode for VoxelNet in lidar Args : boxes ( [ N 7 ] Tensor ) : normal boxes : x y z w l h r anchors ( [ N 7 ] Tensor ) : anchors
def bev_box_decode(box_encodings,
                   anchors,
                   encode_angle_to_vector=False,
                   smooth_dim=False):
    """box decode for VoxelNet in lidar
    Args:
        boxes ([N, 7] Tensor): normal boxes: x, y, z, w, l, h, r
        anchors ([N, 7] Tensor): anchors
    """
    # need to convert box_encodings to z-bottom format
    xa, ya, wa, la, ra = np.split(anchors, 5, axis=-1)
    if encode_angle_to_vector:
        xt, yt, wt, lt, rtx, rty = np.split(box_encodings, 6, axis=-1)
    else:
        xt, yt, wt, lt, rt = np.split(box_encodings, 5, axis=-1)
    diagonal = np.sqrt(la**2 + wa**2)
    xg = xt * diagonal + xa
    yg = yt * diagonal + ya
    if smooth_dim:
        lg = (lt + 1) * la
        wg = (wt + 1) * wa
    else:
        lg = np.exp(lt) * la
        wg = np.exp(wt) * wa
    if encode_angle_to_vector:
        rax = np.cos(ra)
        ray = np.sin(ra)
        rgx = rtx + rax
        rgy = rty + ray
        rg = np.arctan2(rgy, rgx)
    else:
        rg = rt + ra
    return np.concatenate([xg, yg, wg, lg, rg], axis=-1)
def bev_box_decode ( box_encodings , anchors , encode_angle_to_vector = False , smooth_dim = False ) : # need to convert box_encodings to z-bottom format xa , ya , wa , la , ra = np . split ( anchors , 5 , axis = - 1 ) if encode_angle_to_vector : xt , yt , wt , lt , rtx , rty = np . split ( box_encodings , 6 , axis = - 1 ) else : xt , yt , wt , lt , rt = np . split ( box_encodings , 5 , axis = - 1 ) diagonal = np . sqrt ( la ** 2 + wa ** 2 ) xg = xt * diagonal + xa yg = yt * diagonal + ya if smooth_dim : lg = ( lt + 1 ) * la wg = ( wt + 1 ) * wa else : lg = np . exp ( lt ) * la wg = np . exp ( wt ) * wa if encode_angle_to_vector : rax = np . cos ( ra ) ray = np . sin ( ra ) rgx = rtx + rax rgy = rty + ray rg = np . arctan2 ( rgy , rgx ) else : rg = rt + ra return np . concatenate ( [ xg , yg , wg , lg , rg ] , axis = - 1 )