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

邯郸中国建设银行网站wordpress文章页获取标签代码

邯郸中国建设银行网站,wordpress文章页获取标签代码,免费建筑设计素材网站,网站广告制作论文题目#xff1a;《Coordinate Attention for Efficient Mobile NetWork Design》论文地址#xff1a; https://arxiv.org/pdf/2103.02907.pdf 本文中#xff0c;作者通过将位置信息嵌入到通道注意力中提出了一种新颖的移动网络注意力机制#xff0c;将其称为“Coordin…论文题目《Coordinate Attention for Efficient Mobile NetWork Design》论文地址  https://arxiv.org/pdf/2103.02907.pdf 本文中作者通过将位置信息嵌入到通道注意力中提出了一种新颖的移动网络注意力机制将其称为“Coordinate Attention”。与通过2维全局池化将特征张量转换为单个特征向量的通道注意力不同Coordinate注意力将通道注意力分解为两个1维特征编码过程分别沿2个空间方向聚合特征。这样可以沿一个空间方向捕获远程依赖关系同时可以沿另一空间方向保留精确的位置信息。然后将生成的特征图分别编码为一对方向感知和位置敏感的attention map可以将其互补地应用于输入特征图以增强关注对象的表示。 不同于通道注意力将输入通过2D全局池化转化为单个特征向量CoordAttention将通道注意力分解为两个沿着不同方向聚合特征的1D特征编码过程。这样的好处是可以沿着一个空间方向捕获长程依赖沿着另一个空间方向保留精确的位置信息。然后将生成的特征图分别编码形成一对方向感知和位置敏感的特征图它们可以互补地应用到输入特征图来增强感兴趣的目标的表示   下面附上改进代码 YOLOv5改进 common中加入 class h_sigmoid(nn.Module):def __init__(self, inplaceTrue):super(h_sigmoid, self).__init__()self.relu nn.ReLU6(inplaceinplace)def forward(self, x):return self.relu(x 3) / 6class h_swish(nn.Module):def __init__(self, inplaceTrue):super(h_swish, self).__init__()self.sigmoid h_sigmoid(inplaceinplace)def forward(self, x):return x * self.sigmoid(x) class CA(nn.Module):# Coordinate Attention for Efficient Mobile Network DesignRecent studies on mobile network design have demonstrated the remarkable effectiveness of channel attention (e.g., the Squeeze-and-Excitation attention) for liftingmodel performance, but they generally neglect the positional information, which is important for generating spatially selective attention maps. In this paper, we propose anovel attention mechanism for mobile iscyy networks by embedding positional information into channel attention, whichwe call “coordinate attention”. Unlike channel attentionthat transforms a feature tensor to a single feature vector iscyy via 2D global pooling, the coordinate attention factorizes channel attention into two 1D feature encoding processes that aggregate features along the two spatial directions, respectivelydef __init__(self, inp, oup, reduction32):super(CA, self).__init__()mip max(8, inp // reduction)self.conv1 nn.Conv2d(inp, mip, kernel_size1, stride1, padding0)self.bn1 nn.BatchNorm2d(mip)self.act h_swish()self.conv_h nn.Conv2d(mip, oup, kernel_size1, stride1, padding0)self.conv_w nn.Conv2d(mip, oup, kernel_size1, stride1, padding0)def forward(self, x):identity xn,c,h,w x.size()pool_h nn.AdaptiveAvgPool2d((h, 1))pool_w nn.AdaptiveAvgPool2d((1, w))x_h pool_h(x)x_w pool_w(x).permute(0, 1, 3, 2)y torch.cat([x_h, x_w], dim2)y self.conv1(y)y self.bn1(y)y self.act(y) x_h, x_w torch.split(y, [h, w], dim2)x_w x_w.permute(0, 1, 3, 2)a_h self.conv_h(x_h).sigmoid()a_w self.conv_w(x_w).sigmoid()out identity * a_w * a_hreturn out 在yolo.py中注册 找到parse.model模块   加入下列代码 elif m in [CA]:c1, c2 ch[f], args[0]if c2 ! no: # if not outputssc2 make_divisible(c2 * gw, 8)args [c1, c2, *args[1:]]添加配置文件 # YOLOv5 , GPL-3.0 license# Parameters nc: 80 # number of classes depth_multiple: 0.33 # model depth iscyy multiple width_multiple: 0.50 # layer channel iscyy multiple anchors:- [10,13, 16,30, 33,23] # P3/8- [30,61, 62,45, 59,119] # P4/16- [116,90, 156,198, 373,326] # P5/32# YOLOv5 v6.0 backbone backbone:# [from, number, module, args][[-1, 1, Conv, [64, 6, 2, 2]], # 0-P1/2[-1, 1, Conv, [128, 3, 2]], # 1-P2/4[-1, 3, C3, [128]],[-1, 1, Conv, [256, 3, 2]], # 3-P3/8[-1, 6, C3, [256]],[-1, 1, Conv, [512, 3, 2]], # 5-P4/16[-1, 9, C3, [512]],[-1, 1, Conv, [1024, 3, 2]], # 7-P5/32[-1, 3, C3, [1024]],[-1, 1, SPPF, [1024, 5]], # 9]# YOLOv5 v6.0 head head:[[-1, 1, Conv, [512, 1, 1]],[-1, 1, nn.Upsample, [None, 2, nearest]],[[-1, 6], 1, Concat, [1]], # cat backbone P4[-1, 3, C3, [512, False]], # 13[-1, 1, Conv, [256, 1, 1]],[-1, 1, nn.Upsample, [None, 2, nearest]],[[-1, 4], 1, Concat, [1]], # cat backbone P3[-1, 3, C3, [256, False]], # 17 (P3/8-small)[-1, 1, Conv, [256, 3, 2]],[[-1, 14], 1, Concat, [1]], # cat head P4[-1, 3, C3, [512, False]], # 20 (P4/16-medium)[-1, 1, Conv, [512, 3, 2]],[[-1, 10], 1, Concat, [1]], # cat head P5[-1, 3, C3, [1024, False]], # 23 (P5/32-large)[-1, 1, CA, [1024]],[[17, 20, 24], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)]到此YOLOv5就改好了 下面介绍yolov7 同样在common中加入以下代码 class h_sigmoid(nn.Module):def __init__(self, inplaceTrue):super(h_sigmoid, self).__init__()self.relu nn.ReLU6(inplaceinplace)def forward(self, x):return self.relu(x 3) / 6class h_swish(nn.Module):def __init__(self, inplaceTrue):super(h_swish, self).__init__()self.sigmoid h_sigmoid(inplaceinplace)def forward(self, x):return x * self.sigmoid(x) class CA(nn.Module):# Coordinate Attention for Efficient Mobile Network DesignRecent studies on mobile network design have demonstrated the remarkable effectiveness of channel attention (e.g., the Squeeze-and-Excitation attention) for liftingmodel performance, but they generally neglect the positional information, which is important for generating spatially selective attention maps. In this paper, we propose anovel attention mechanism for mobile iscyy networks by embedding positional information into channel attention, whichwe call “coordinate attention”. Unlike channel attentionthat transforms a feature tensor to a single feature vector iscyy via 2D global pooling, the coordinate attention factorizes channel attention into two 1D feature encoding processes that aggregate features along the two spatial directions, respectivelydef __init__(self, inp, oup, reduction32):super(CA, self).__init__()mip max(8, inp // reduction)self.conv1 nn.Conv2d(inp, mip, kernel_size1, stride1, padding0)self.bn1 nn.BatchNorm2d(mip)self.act h_swish()self.conv_h nn.Conv2d(mip, oup, kernel_size1, stride1, padding0)self.conv_w nn.Conv2d(mip, oup, kernel_size1, stride1, padding0)def forward(self, x):identity xn,c,h,w x.size()pool_h nn.AdaptiveAvgPool2d((h, 1))pool_w nn.AdaptiveAvgPool2d((1, w))x_h pool_h(x)x_w pool_w(x).permute(0, 1, 3, 2)y torch.cat([x_h, x_w], dim2)y self.conv1(y)y self.bn1(y)y self.act(y) x_h, x_w torch.split(y, [h, w], dim2)x_w x_w.permute(0, 1, 3, 2)a_h self.conv_h(x_h).sigmoid()a_w self.conv_w(x_w).sigmoid()out identity * a_w * a_hreturn out 在yolo.py中注册 找到parse.model模块   加入下列代码 elif m in [CA]:c1, c2 ch[f], args[0]if c2 ! no: # if not outputssc2 make_divisible(c2 * gw, 8)args [c1, c2, *args[1:]]添加配置文件 # YOLOv7 , GPL-3.0 license # parameters nc: 80 # number of classes depth_multiple: 1.0 # model depth multiple width_multiple: 1.0 # layer channel iscyy multiple# anchors anchors:- [12,16, 19,36, 40,28] # P3/8- [36,75, 76,55, 72,146] # P4/16- [142,110, 192,243, 459,401] # P5/32# yolov7 backbone backbone:# [from, number, module, args][[-1, 1, Conv, [32, 3, 1]], # 0[-1, 1, Conv, [64, 3, 2]], # 1-P1/2[-1, 1, Conv, [64, 3, 1]],[-1, 1, Conv, [128, 3, 2]], # 3-P2/4 [-1, 1, C3, [128]], [-1, 1, Conv, [256, 3, 2]], [-1, 1, MP, []],[-1, 1, Conv, [128, 1, 1]],[-3, 1, Conv, [128, 1, 1]],[-1, 1, Conv, [128, 3, 2]],[[-1, -3], 1, Concat, [1]], # 16-P3/8[-1, 1, Conv, [128, 1, 1]],[-2, 1, Conv, [128, 1, 1]],[-1, 1, Conv, [128, 3, 1]],[-1, 1, Conv, [128, 3, 1]],[-1, 1, Conv, [128, 3, 1]],[-1, 1, Conv, [128, 3, 1]],[[-1, -3, -5, -6], 1, Concat, [1]],[-1, 1, Conv, [512, 1, 1]],[-1, 1, MP, []],[-1, 1, Conv, [256, 1, 1]],[-3, 1, Conv, [256, 1, 1]],[-1, 1, Conv, [256, 3, 2]],[[-1, -3], 1, Concat, [1]],[-1, 1, Conv, [256, 1, 1]],[-2, 1, Conv, [256, 1, 1]],[-1, 1, Conv, [256, 3, 1]],[-1, 1, Conv, [256, 3, 1]],[-1, 1, Conv, [256, 3, 1]],[-1, 1, Conv, [256, 3, 1]],[[-1, -3, -5, -6], 1, Concat, [1]],[-1, 1, Conv, [1024, 1, 1]], [-1, 1, MP, []],[-1, 1, Conv, [512, 1, 1]],[-3, 1, Conv, [512, 1, 1]],[-1, 1, Conv, [512, 3, 2]],[[-1, -3], 1, Concat, [1]],[-1, 1, C3, [1024]],[-1, 1, Conv, [256, 3, 1]],]# yolov7 head by iscyy head:[[-1, 1, SPPCSPC, [512]],[-1, 1, Conv, [256, 1, 1]],[-1, 1, nn.Upsample, [None, 2, nearest]],[31, 1, Conv, [256, 1, 1]],[[-1, -2], 1, Concat, [1]],[-1, 1, C3, [128]],[-1, 1, Conv, [128, 1, 1]],[-1, 1, nn.Upsample, [None, 2, nearest]],[18, 1, Conv, [128, 1, 1]],[[-1, -2], 1, Concat, [1]],[-1, 1, C3, [128]],[-1, 1, MP, []],[-1, 1, Conv, [128, 1, 1]],[-3, 1, CA, [128]],[-1, 1, Conv, [128, 3, 2]],[[-1, -3, 44], 1, Concat, [1]],[-1, 1, C3, [256]], [-1, 1, MP, []],[-1, 1, Conv, [256, 1, 1]],[-3, 1, Conv, [256, 1, 1]],[-1, 1, Conv, [256, 3, 2]], [[-1, -3, 39], 1, Concat, [1]],[-1, 3, C3, [512]],# 检测头 -----------------------------[49, 1, RepConv, [256, 3, 1]],[55, 1, RepConv, [512, 3, 1]],[61, 1, RepConv, [1024, 3, 1]],[[62,63,64], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)]至此v7就配置完成了 v8的配置同v5是一样的。
http://www.pierceye.com/news/920767/

相关文章:

  • 手机网站页面模板企业网站建设相关书籍在线阅读
  • 服装网站建设内容asp网站服务建设论文
  • 开封 网站建设 网络推广如何用xshell安装wordpress
  • 河北建设工程信息网站银行外包不是人干的
  • 郑州免费做网站的襄阳品牌网站建设
  • 爱网站站长工具android软件开发下载
  • 网站被入侵宁波妇科医生推荐
  • 移动网站建设学习新能源汽车价格表2021
  • 如何做视频会员网站工商注册公司需要提供的资料
  • 网站做多久能盈利网站设计定做
  • 微信网站后台功能哪里买域名便宜
  • 合肥重点工程建设局密云seo排名优化培训
  • 二学一做网站福建建设资格执业注册管理中心网站
  • vps 网站上传做网站费用需要分摊吗
  • 建网站 考虑oou淘宝客图片wordpress模板
  • 玩具网站开发背景小说网站开发文档
  • 遵义网站设计公司制作网站需要
  • 做广告公司网站建设价格成都seo招聘
  • 网站建设与规划试卷友联互换
  • 宠物网站建设费用天元建设集团有限公司是国企吗
  • 南宁在百度上建网站网站设计怎么做链接
  • 多多进宝怎么做自己网站沈阳正规的男科医院
  • 做简历的网站叫什么软件外贸网站建设工作计划
  • 关键词搜索引擎网站公司要求做网站
  • 如何判断网站开发语言浙江省网站建设报价
  • 建设一个网站思路有关网站建设的网站
  • 网站文明建设工程包括做电影网站什么后果
  • 邯郸市有搞网站服服务的吗怎样免费建设免费网站
  • 衡水学校网站建设wordpress后台中文安装
  • 英文网站建站模板电子名片制作app