赞
踩
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-holbgr9I-1721496039065)(https://i-blog.csdnimg.cn/direct/2d211eaddcc147bb8ba92956eaf4a0ad.png#pic_center =800x)]
WidthFormer是一种轻量级且易于部署的BEV变换方法,它使用单层transformer解码器来计算BEV表示。除此之外,还提出了参考位置编码(RefPE),这是一种新的用于3D对象检测的位置编码机制,以辅助WidthFormer的视图转换,重点来啦!它还可以用于以即插即用的方式提高稀疏3D检测器的性能。
函数源码和原理解析
def create_frustum(self): # make grid in image plane ogfH, ogfW = self.data_config['input_size']#原始图像的高度和宽度 (256,704) fH, fW = ogfH // self.downsample, ogfW // self.downsample# feature图高度和宽度 (16,44) if not self.LID: #均匀分布 ds = torch.arange(*self.grid_config['dbound'], dtype=torch.float).view(-1, 1, 1).expand(-1, fH, fW) # dp in 3d grid:(59,16,44) 59 depths in gridsize(16,44) else:#深度值不是均匀分布 # reference: PETR depth_start, depth_end, depth_step = self.grid_config['dbound'] depth_num = (depth_end - depth_start) // depth_step index = torch.arange(start=0, end=depth_num, step=1).float() index_1 = index + 1 bin_size = (depth_end + 1 - depth_start) / (depth_num * (1. + depth_num)) ds = depth_start + bin_size * index * index_1 ds = ds.view(-1, 1, 1).expand(-1, fH, fW) D, _, _ = ds.shape xs = torch.linspace(0, ogfW - 1, fW, dtype=torch.float).view(1, 1, fW).expand(D, fH, fW)# pixel_x in 3d grid ys = torch.linspace(0, ogfH - 1, fH, dtype=torch.float).view(1, fH, 1).expand(D, fH, fW)# pixel_y in 3d grid #
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。