(box_encodings,
                      anchors,
                      encode_angle_to_vector=False,
                      smooth_dim=False)
return np.concatenate([xg, yg, zg, wg, lg, hg, rg, *cgs], 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 second_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
    box_ndim = anchors.shape[-1]
    cas, cts = [], []
    if box_ndim > 7:
        xa, ya, za, wa, la, ha, ra, *cas = np.split(anchors, box_ndim, axis=-1)
        if encode_angle_to_vector:
            xt, yt, zt, wt, lt, ht, rtx, rty, *cts = np.split(box_encodings, box_ndim + 1, axis=-1)
        else:
            xt, yt, zt, wt, lt, ht, rt, *cts = np.split(box_encodings, box_ndim, axis=-1)
    else:
        xa, ya, za, wa, la, ha, ra = np.split(anchors, box_ndim, axis=-1)
        if encode_angle_to_vector:
            xt, yt, zt, wt, lt, ht, rtx, rty = np.split(box_encodings, box_ndim + 1, axis=-1)
        else:
            xt, yt, zt, wt, lt, ht, rt = np.split(box_encodings, box_ndim, axis=-1)

    diagonal = np.sqrt(la**2 + wa**2)
    xg = xt * diagonal + xa
    yg = yt * diagonal + ya
    zg = zt * ha + za
    if smooth_dim:
        lg = (lt + 1) * la
        wg = (wt + 1) * wa
        hg = (ht + 1) * ha
    else:
        lg = np.exp(lt) * la
        wg = np.exp(wt) * wa
        hg = np.exp(ht) * ha
    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
    cgs = [t + a for t, a in zip(cts, cas)]
    return np.concatenate([xg, yg, zg, wg, lg, hg, rg, *cgs], axis=-1)
def second_box_decode ( box_encodings , anchors , encode_angle_to_vector = False , smooth_dim = False ) : # need to convert box_encodings to z-bottom format box_ndim = anchors . shape [ - 1 ] cas , cts = [ ] , [ ] if box_ndim > 7 : xa , ya , za , wa , la , ha , ra , * cas = np . split ( anchors , box_ndim , axis = - 1 ) if encode_angle_to_vector : xt , yt , zt , wt , lt , ht , rtx , rty , * cts = np . split ( box_encodings , box_ndim + 1 , axis = - 1 ) else : xt , yt , zt , wt , lt , ht , rt , * cts = np . split ( box_encodings , box_ndim , axis = - 1 ) else : xa , ya , za , wa , la , ha , ra = np . split ( anchors , box_ndim , axis = - 1 ) if encode_angle_to_vector : xt , yt , zt , wt , lt , ht , rtx , rty = np . split ( box_encodings , box_ndim + 1 , axis = - 1 ) else : xt , yt , zt , wt , lt , ht , rt = np . split ( box_encodings , box_ndim , axis = - 1 ) diagonal = np . sqrt ( la ** 2 + wa ** 2 ) xg = xt * diagonal + xa yg = yt * diagonal + ya zg = zt * ha + za if smooth_dim : lg = ( lt + 1 ) * la wg = ( wt + 1 ) * wa hg = ( ht + 1 ) * ha else : lg = np . exp ( lt ) * la wg = np . exp ( wt ) * wa hg = np . exp ( ht ) * ha 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 cgs = [ t + a for t , a in zip ( cts , cas ) ] return np . concatenate ( [ xg , yg , zg , wg , lg , hg , rg , * cgs ] , axis = - 1 )