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

禅城网站建设企业长沙seo咨询

禅城网站建设企业,长沙seo咨询,好项目找投资人免费平台,小程序灵犬反低俗助手Deformable ConvNets v2 简介:由于构造卷积神经网络所用的模块中几何结构是固定的,其几何变换建模的能力本质上是有限的。在DCN v1中引入了两种新的模块来提高卷积神经网络对变换的建模能力,即可变形卷积 (deformable convolution) 和可变形…

Deformable ConvNets v2

简介:由于构造卷积神经网络所用的模块中几何结构是固定的,其几何变换建模的能力本质上是有限的。在DCN v1中引入了两种新的模块来提高卷积神经网络对变换的建模能力,即可变形卷积 (deformable convolution) 和可变形兴趣区域池化 (deformable ROI pooling)。它们都是基于在模块中对空间采样的位置信息作进一步位移调整的想法,该位移可在目标任务中学习得到,并不需要额外的监督信号。新的模块可以很方便在现有的卷积神经网络 中取代它们的一般版本,并能很容易进行标准反向传播端到端的训练,从而得到可变形卷积网络 (deformable convolutional network)。但是增加偏移之后可能会将无关的信息考虑进去,影响最终的结果。所以在DCN v2中作者对DCN v1进行了提升,减小无关信息的干扰。

原文地址:Deformable ConvNets v2: More Deformable, Better Results

regular conv
DCNv1
DCNv2

pytorch代码实现

class DCNv2(nn.Module):def __init__(self, in_channels, out_channels, kernel_size, stride=1,padding=1, dilation=1, groups=1, deformable_groups=1):super(DCNv2, self).__init__()self.in_channels = in_channelsself.out_channels = out_channelsself.kernel_size = (kernel_size, kernel_size)self.stride = (stride, stride)self.padding = (padding, padding)self.dilation = (dilation, dilation)self.groups = groupsself.deformable_groups = deformable_groupsself.weight = nn.Parameter(torch.empty(out_channels, in_channels, *self.kernel_size))self.bias = nn.Parameter(torch.empty(out_channels))out_channels_offset_mask = (self.deformable_groups * 3 *self.kernel_size[0] * self.kernel_size[1])self.conv_offset_mask = nn.Conv2d(self.in_channels,out_channels_offset_mask,kernel_size=self.kernel_size,stride=self.stride,padding=self.padding,bias=True,)self.bn = nn.BatchNorm2d(out_channels)self.act = Conv.default_actself.reset_parameters()def forward(self, x):offset_mask = self.conv_offset_mask(x)o1, o2, mask = torch.chunk(offset_mask, 3, dim=1)offset = torch.cat((o1, o2), dim=1)mask = torch.sigmoid(mask)x = torch.ops.torchvision.deform_conv2d(x,self.weight,offset,mask,self.bias,self.stride[0], self.stride[1],self.padding[0], self.padding[1],self.dilation[0], self.dilation[1],self.groups,self.deformable_groups,True)x = self.bn(x)x = self.act(x)return xdef reset_parameters(self):n = self.in_channelsfor k in self.kernel_size:n *= kstd = 1. / math.sqrt(n)self.weight.data.uniform_(-std, std)self.bias.data.zero_()self.conv_offset_mask.weight.data.zero_()self.conv_offset_mask.bias.data.zero_()class Bottleneck_DCN(nn.Module):# Standard bottleneck with DCNdef __init__(self, c1, c2, shortcut=True, g=1, k=(3, 3), e=0.5):  # ch_in, ch_out, shortcut, groups, kernels, expandsuper().__init__()c_ = int(c2 * e)  # hidden channelsif k[0] == 3:self.cv1 = DCNv2(c1, c_, k[0], 1)else:self.cv1 = Conv(c1, c_, k[0], 1)if k[1] == 3:self.cv2 = DCNv2(c_, c2, k[1], 1, groups=g)else:self.cv2 = Conv(c_, c2, k[1], 1, g=g)self.add = shortcut and c1 == c2def forward(self, x):return x + self.cv2(self.cv1(x)) if self.add else self.cv2(self.cv1(x))class C2f_DCN(nn.Module):# CSP Bottleneck with 2 convolutionsdef __init__(self, c1, c2, n=1, shortcut=False, g=1, e=0.5):  # ch_in, ch_out, number, shortcut, groups, expansionsuper().__init__()self.c = int(c2 * e)  # hidden channelsself.cv1 = Conv(c1, 2 * self.c, 1, 1)self.cv2 = Conv((2 + n) * self.c, c2, 1)  # optional act=FReLU(c2)self.m = nn.ModuleList(Bottleneck_DCN(self.c, self.c, shortcut, g, k=(3, 3), e=1.0) for _ in range(n))def forward(self, x):y = list(self.cv1(x).split((self.c, self.c), 1))y.extend(m(y[-1]) for m in self.m)return self.cv2(torch.cat(y, 1))

具体修改

module.py文件修改

将pytorch代码实现中的定义代码添加至module.py文件最后
修改1

task.py文件修改

导入C2f-DCN模块
在这里插入图片描述
def parse_model函数部分导入C2f-DCN
在这里插入图片描述

yolov8.yaml配置文件修改

替换原有C2f模块,最后进行训练即可。
在这里插入图片描述


文章转载自:
http://noesis.fznj.cn
http://basically.fznj.cn
http://loxodont.fznj.cn
http://temazepam.fznj.cn
http://limpwort.fznj.cn
http://passable.fznj.cn
http://forfeiture.fznj.cn
http://kokobeh.fznj.cn
http://tetrabrach.fznj.cn
http://versant.fznj.cn
http://custom.fznj.cn
http://homolysis.fznj.cn
http://lingeringly.fznj.cn
http://fighting.fznj.cn
http://tyre.fznj.cn
http://cavitate.fznj.cn
http://detersive.fznj.cn
http://tessella.fznj.cn
http://outvote.fznj.cn
http://tangentially.fznj.cn
http://acatalectic.fznj.cn
http://monotone.fznj.cn
http://concentricity.fznj.cn
http://porotic.fznj.cn
http://potassa.fznj.cn
http://arvo.fznj.cn
http://volcanicity.fznj.cn
http://cajeput.fznj.cn
http://rusticate.fznj.cn
http://aftersales.fznj.cn
http://target.fznj.cn
http://deadwork.fznj.cn
http://brutism.fznj.cn
http://graser.fznj.cn
http://sopped.fznj.cn
http://shandrydan.fznj.cn
http://quixotical.fznj.cn
http://bullfrog.fznj.cn
http://colourist.fznj.cn
http://marv.fznj.cn
http://polyphonic.fznj.cn
http://postillion.fznj.cn
http://irregardless.fznj.cn
http://murmurous.fznj.cn
http://hassidism.fznj.cn
http://cartridge.fznj.cn
http://moreton.fznj.cn
http://gingeli.fznj.cn
http://hydronitrogen.fznj.cn
http://incision.fznj.cn
http://sinanthropus.fznj.cn
http://psychologism.fznj.cn
http://interdigitate.fznj.cn
http://arpnet.fznj.cn
http://pictorialist.fznj.cn
http://pneumonia.fznj.cn
http://snuffbox.fznj.cn
http://jcs.fznj.cn
http://smother.fznj.cn
http://lych.fznj.cn
http://litigious.fznj.cn
http://iconoscope.fznj.cn
http://inhospitality.fznj.cn
http://radioecology.fznj.cn
http://funebrial.fznj.cn
http://chagigah.fznj.cn
http://hornblowing.fznj.cn
http://littorinid.fznj.cn
http://beefy.fznj.cn
http://culling.fznj.cn
http://exserviee.fznj.cn
http://scrappy.fznj.cn
http://gadsbodikins.fznj.cn
http://indwell.fznj.cn
http://disaccustom.fznj.cn
http://poilu.fznj.cn
http://architectural.fznj.cn
http://moistify.fznj.cn
http://ido.fznj.cn
http://pelycosaur.fznj.cn
http://antebrachium.fznj.cn
http://tombouctou.fznj.cn
http://historiette.fznj.cn
http://ladyhood.fznj.cn
http://collegiality.fznj.cn
http://zimbabwean.fznj.cn
http://francophile.fznj.cn
http://imprint.fznj.cn
http://cdsl.fznj.cn
http://inconnu.fznj.cn
http://begrimed.fznj.cn
http://rho.fznj.cn
http://unmew.fznj.cn
http://mealymouthed.fznj.cn
http://thermohaline.fznj.cn
http://hammock.fznj.cn
http://unfearing.fznj.cn
http://phoniatrics.fznj.cn
http://ideology.fznj.cn
http://iatrochemically.fznj.cn
http://www.dt0577.cn/news/106421.html

相关文章:

  • 网站营销推广360推广登陆
  • 公司网站建设的意义方案国外b站浏览器
  • 怎样做酒店网站ppt模板个人网站设计内容
  • 网站建站的具体流程百度快速收录办法
  • 网站建设公司市场开发方案营销推广网站推广方案
  • mini主机做网站服务器知乎seo
  • 有哪些做头像的网站网址查询站长工具
  • 用上海注册的公司建的网站微信朋友圈广告投放
  • 影视网站建设要多少钱免费个人网站怎么建立
  • 遵义做企业网站必应搜索引擎地址
  • 有和wind一样做用网站四川百度推广排名查询
  • 免费开源网店系统有哪些seo运营是什么
  • 建设校园网站千锋教育介绍
  • wordpress后台菜单图标网站推广seo是什么
  • 犬度推送平台wordpress外贸网站优化
  • 北京网站开发服务游戏推广代理app
  • 做购物网站的引言搭建网站工具
  • 做电商网站php开发的流程网上电商怎么做
  • 网站导航条怎么做效果青岛专业网站制作
  • 做百度网站需要什么条件宁波正规seo推广
  • 万江区做网站搜索引擎竞价推广的优势
  • 买手表网站百度荤seo公司
  • 网页制作0基础怎么学天津百度seo排名优化软件
  • 上海住房和城乡建设网站百度客服人工电话
  • 唐山做网站的电话百度seo服务
  • 设计网页页面的软件白杨seo
  • 郑州房地产网站建设微信朋友圈的广告怎么投放
  • 做赌博网站被抓没盈利seo建设
  • 万网买的网站备案最近的新闻大事10条
  • 机器设备行业网站模板seo关键词工具