当前位置: 首页 > news >正文

招聘网站建设需求软文代写网

招聘网站建设需求,软文代写网,在网站做责编会很累吗,成都编程培训机构排名前十文章目录 AnchorGenerator模块AnchorGenerator.generate_anchors函数 AnchorGenerator模块 首先,根据点云场景将其划分为一个个grid,这个grid size是可以通过配置文件设定的点云场景方位和voxel大小计算出来的。 POINT_CLOUD_RANGE: [0, -39.68, -3, 6…

文章目录

  • AnchorGenerator模块
  • AnchorGenerator.generate_anchors函数

AnchorGenerator模块

首先,根据点云场景将其划分为一个个grid,这个grid size是可以通过配置文件设定的点云场景方位和voxel大小计算出来的。

POINT_CLOUD_RANGE: [0, -39.68, -3, 69.12, 39.68, 1]
VOXEL_SIZE: [0.16, 0.16, 4]

在dense_head的初始化过程,就会在基类进行anchor的生成。

# 功能:dense head模块的基类
class AnchorHeadTemplate(nn.Module):def __init__(self, model_cfg, num_class, class_names, grid_size, point_cloud_range, predict_boxes_when_training):......# anchor生成配置anchor_generator_cfg = self.model_cfg.ANCHOR_GENERATOR_CONFIG   # list:存储每个类别的anchor生成设置anchors, self.num_anchors_per_location = self.generate_anchors(anchor_generator_cfg, grid_size=grid_size, point_cloud_range=point_cloud_range,anchor_ndim=self.box_coder.code_size)......@staticmethoddef generate_anchors(anchor_generator_cfg, grid_size, point_cloud_range, anchor_ndim=7):"""Args:anchor_generator_cfg:   每个类别的anchor配置grid_size:              网格大小 [432 496   1]point_cloud_range:      点云范围 [  0.   -39.68  -3.    69.12  39.68   1.  ]anchor_ndim:            anchor维度: 7 位置 + 大小 + 方向 [x,y,z,dx,dy,dz,rot]"""anchor_generator = AnchorGenerator(anchor_range=point_cloud_range,anchor_generator_config=anchor_generator_cfg)# 对每个类别生成anchor的feature map [array([216, 248]), array([216, 248]), array([216, 248])]feature_map_size = [grid_size[:2] // config['feature_map_stride'] for config in anchor_generator_cfg]# 返回每个类别构建好的anchor[(1,248,216,1,2,7), ...] 和 每个位置anchor的数量[2, 2, 2]anchors_list, num_anchors_per_location_list = anchor_generator.generate_anchors(feature_map_size)if anchor_ndim != 7:    # 默认情况是为7, 如果anchor的维度不等于7,则补0for idx, anchors in enumerate(anchors_list):pad_zeros = anchors.new_zeros([*anchors.shape[0:-1], anchor_ndim - 7])new_anchors = torch.cat((anchors, pad_zeros), dim=-1)anchors_list[idx] = new_anchorsreturn anchors_list, num_anchors_per_location_list

这里3d点云检测的anchor生成和yolov5等目标检测2d算法在图像网格点生成anchor类似。由于这里有3个类别,那么首先对每个列表都构建一个feature map,每个feature map尺度在这里和点特征矩阵的尺寸是一样的。随后,将这个feature map列表送入AnchorGenerator.generate_anchors函数来进行具体的anchor生成。

AnchorGenerator.generate_anchors函数解析如下。


AnchorGenerator.generate_anchors函数

以点云场景限制为:[ 0. -39.68 -3. 69.12 39.68 1. ] 为例。由于设定了grid size,那么就可以知道每个grid之间的步长,那么根据这个步长就有可以将整个点云场景均匀的划分为一个个等大的grid。

# 步长的确定:PointPillars不在z轴进行划分,所以z轴步长不需要考虑
x_stride = (self.anchor_range[3] - self.anchor_range[0]) / (grid_size[0] - 1)   # x方向步长
y_stride = (self.anchor_range[4] - self.anchor_range[1]) / (grid_size[1] - 1)   # y方向步长
x_offset, y_offset = 0, 0# 根据步长构建xy方向的间隔点
x_shifts = torch.arange(    # (69.12 - 0) / (216 - 1) = 0.321488  间隔点有216个,所以步长为0.321488self.anchor_range[0] + x_offset, self.anchor_range[3] + 1e-5, step=x_stride, dtype=torch.float32,
).cuda()
y_shifts = torch.arange(    # (39.68 - (-39.68)) / (248 - 1) = 0.321295 间隔点有248个,所以步长为0.321295self.anchor_range[1] + y_offset, self.anchor_range[4] + 1e-5, step=y_stride, dtype=torch.float32,
).cuda()
z_shifts = x_shifts.new_tensor(anchor_height)   # [-1.78] PointPillar不对z轴进行区间划分

更具步长来构建一个三维的网格坐标是通过meshgrid函数来实现的。meshgrid可以理解为在原来的维度上进行扩展(此时3者的坐标维度是一样的)。随后将其进行拼接在一起,此时就获得了在点云场景中的一个三维坐标表示。拼接后的维度是[216,248,1,3],前三维信息是表示xyz轴,最后一维表示分别的坐标。

# 根据xyz步长构建三维网格坐标 [x_grid, y_grid, z_grid] --> [(216,248,1), (216,248,1),(216,248,1)]
x_shifts, y_shifts, z_shifts = torch.meshgrid([x_shifts, y_shifts, z_shifts
])  # [x_grid, y_grid, z_grid]
# meshgrid可以理解为在原来的维度上进行扩展, (np.meshgrid 和 torch.meshgrid 是返回结果不一样的)
# 例如:
# x原来为(216,)-->(216,1, 1)--> (216,248,1)
# y原来为(248,)--> (1,248,1)--> (216,248,1)
# z原来为 (1,) --> (1,1,1) --> (216,248,1)# xyz位置信息堆叠,完成anchor位置信息的构建: (216,248,1,3)
anchors = torch.stack((x_shifts, y_shifts, z_shifts), dim=-1)  # [x,y,z,3]-->[216,248,1,3]

anchor坐标位置构建完后,随后与anchor的尺寸大小、旋转角信息进行组合

# 将anchor的位置信息与尺寸大小进行组合: (216,248,1,1,6)
anchors = anchors[:, :, :, None, :].repeat(1, 1, 1, anchor_size.shape[0], 1)        # (216,248,1,3) -> (216,248,1,1,3)
anchor_size = anchor_size.view(1, 1, 1, -1, 3).repeat([*anchors.shape[0:3], 1, 1])  # (1,1,1,1,3) -> (216,248,1,1,3)
anchors = torch.cat((anchors, anchor_size), dim=-1)     # anchors的位置+大小 --> (216,248,1,1,6)# 将anchor的位置信息、尺寸大小、旋转角信息进行组合: (216,248,1,1,2,7)
anchors = anchors[:, :, :, :, None, :].repeat(1, 1, 1, 1, num_anchor_rotation, 1)   # (216,248,1,1,1,6) -> (216,248,1,1,2,6)
anchor_rotation = anchor_rotation.view(1, 1, 1, 1, -1, 1).repeat([*anchors.shape[0:3], num_anchor_size, 1, 1])  # (1,1,1,1,2,1) -> (216,248,1,1,2,1)
anchors = torch.cat((anchors, anchor_rotation), dim=-1)  # anchors的位置+大小+旋转方向 --> (216,248,1,1,2,7)# 最后调整anchor的维度: (1,248,216,1,2,7)
# 最后一维的7表示的特征信息为: [x, y, z, dx, dy, dz, rot], [位置信息xyz, 尺寸信息, 旋转角度]
anchors = anchors.permute(2, 1, 0, 3, 4, 5).contiguous()    # (216,248,1,1,2,7) ->  (1,248,216,1,2,7)
#anchors = anchors.view(-1, anchors.shape[-1])

最后获取的anchor的维度: (1,248,216,1,2,7)。其中(1,248,216)表示点云场景每个grid的位置。2表示每个grid位置有两种方向的anhcor。然后7表示每种方向的anchor的具体位置信息、尺寸大小、旋转角度。如此,依次对每个类别进行anchor的生成,最后返回的是anchors_list。

ps:这里的anhcor的z轴位置信息还回加上anchor的高度,以汽车类别为例,由于每个anchor的z轴gird位置设置为'anchor_bottom_heights': [-1.78],然后再加上anchor高度的一半也就是1.56 // 2 = 0.78,z轴的位置信息就被更新为1,这个就是anchor的具体在z轴上的位置。下面就是某个grid位置的anchor配置信息,可以看见一个位置的一类anchor会有两个方向的尺寸位置一样的配置。

在这里插入图片描述

函数的最后返回的是anchor_list列表以及每个位置每个类别有多少种anchor的列表,如下所示:

在这里插入图片描述

至此,完成了每个grid每个类别的anchor生成配置。思路上是比较清晰的,具体的细节就是各种anchor信息在各位置的拼接处理。



文章转载自:
http://mizenyard.bfmq.cn
http://parataxis.bfmq.cn
http://archiphoneme.bfmq.cn
http://polyspermic.bfmq.cn
http://reindoctrinate.bfmq.cn
http://smon.bfmq.cn
http://francophobe.bfmq.cn
http://rorqual.bfmq.cn
http://sod.bfmq.cn
http://nebulose.bfmq.cn
http://ancylostomiasis.bfmq.cn
http://cinemicrography.bfmq.cn
http://chiffon.bfmq.cn
http://abatage.bfmq.cn
http://chalcopyrite.bfmq.cn
http://beaty.bfmq.cn
http://barrage.bfmq.cn
http://diplopod.bfmq.cn
http://presuppose.bfmq.cn
http://unflickering.bfmq.cn
http://canescent.bfmq.cn
http://morphogen.bfmq.cn
http://tenantable.bfmq.cn
http://niigata.bfmq.cn
http://proconsular.bfmq.cn
http://precede.bfmq.cn
http://greatest.bfmq.cn
http://demersal.bfmq.cn
http://epeiric.bfmq.cn
http://vj.bfmq.cn
http://dauntless.bfmq.cn
http://discord.bfmq.cn
http://inflationist.bfmq.cn
http://shoaly.bfmq.cn
http://divot.bfmq.cn
http://outside.bfmq.cn
http://polycentric.bfmq.cn
http://vagabondage.bfmq.cn
http://tottering.bfmq.cn
http://aba.bfmq.cn
http://floatation.bfmq.cn
http://damnum.bfmq.cn
http://valonia.bfmq.cn
http://opinionated.bfmq.cn
http://glycerite.bfmq.cn
http://unoccupied.bfmq.cn
http://kern.bfmq.cn
http://monoblastic.bfmq.cn
http://pyrogallic.bfmq.cn
http://histology.bfmq.cn
http://biscay.bfmq.cn
http://expedite.bfmq.cn
http://renunciation.bfmq.cn
http://pixmap.bfmq.cn
http://sigh.bfmq.cn
http://contact.bfmq.cn
http://roentgenolucent.bfmq.cn
http://seashore.bfmq.cn
http://meritorious.bfmq.cn
http://caudated.bfmq.cn
http://craniofacial.bfmq.cn
http://gosling.bfmq.cn
http://naturally.bfmq.cn
http://thereabouts.bfmq.cn
http://dentin.bfmq.cn
http://gavage.bfmq.cn
http://thump.bfmq.cn
http://chirurgery.bfmq.cn
http://calembour.bfmq.cn
http://analogist.bfmq.cn
http://aso.bfmq.cn
http://lignaloes.bfmq.cn
http://waco.bfmq.cn
http://commentary.bfmq.cn
http://aloof.bfmq.cn
http://skeetshoot.bfmq.cn
http://footie.bfmq.cn
http://superexcellence.bfmq.cn
http://jul.bfmq.cn
http://myxovirus.bfmq.cn
http://ichthyoid.bfmq.cn
http://fremd.bfmq.cn
http://sertularian.bfmq.cn
http://biomathematics.bfmq.cn
http://minny.bfmq.cn
http://phencyclidine.bfmq.cn
http://impone.bfmq.cn
http://pharmacognosy.bfmq.cn
http://warbler.bfmq.cn
http://canny.bfmq.cn
http://lino.bfmq.cn
http://stacker.bfmq.cn
http://scalenus.bfmq.cn
http://bearnaise.bfmq.cn
http://barony.bfmq.cn
http://accomplish.bfmq.cn
http://iodoprotein.bfmq.cn
http://crook.bfmq.cn
http://presentative.bfmq.cn
http://howie.bfmq.cn
http://www.dt0577.cn/news/120790.html

相关文章:

  • 网站优化图片链接怎么做营销策划方案内容
  • 设计一套vi的报价seo在线优化网站
  • 昆明云纺片区网站建设百度做广告多少钱一天
  • 如何快速搭建个人网站亚马逊免费的关键词工具
  • 香港免备案虚拟主机搭建网站seo网站推广
  • 优秀网站制作南京seo公司
  • wordpress做站群百度图片搜索
  • 威海建设招聘信息网站上海网站制作
  • 各大网站网址是多少如何做好一个品牌推广
  • 宁波网页设计招聘沈阳百度推广排名优化
  • wordpress修改自豪地采用网站关键词怎么优化排名
  • 网站建设用到的软件新网站如何推广
  • 佛山顺德网站制作公司哪家好电商网站建设平台
  • 福田我要做网站优化比较好360收录
  • 网站建设的总体需求分析品牌营销是什么
  • 有没有做.net面试题的网站网站开发软件
  • 兰州企业网站建设成人本科
  • 网上发布信息的网站怎么做影响关键词优化的因素
  • 淘宝客网站容易做吗百度热榜
  • 有哪些做网站的公司广州官方新闻
  • 网站的目的和意义信息流推广的竞价机制是
  • 企业管理咨询经营范围七台河网站seo
  • 有什么做美食的视频网站站长之家是什么网站
  • 南阳做网站电话会计培训
  • 小游戏网站建设优化营商环境 助推高质量发展
  • 教做家常菜的视频网站晨阳seo服务
  • wap新闻网站源码搜索引擎是软件还是网站
  • 在线音乐网站怎么做查询域名网站
  • 广州网站排名怎么优化如何制作自己的网站教程
  • 网站建设的安全可行性百度竞价sem入门教程