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

怀化seo神马seo服务

怀化seo,神马seo服务,国内永久在线免费建站,大连公司做网站代码基于yolov5 v6.0 目录: yolo源码注释1——文件结构yolo源码注释2——数据集配置文件yolo源码注释3——模型配置文件yolo源码注释4——yolo-py yolo.py 用于搭建 yolov5 的网络模型,主要包含 3 部分: Detect:Detect 层Model…

代码基于yolov5 v6.0

目录:

  • yolo源码注释1——文件结构
  • yolo源码注释2——数据集配置文件
  • yolo源码注释3——模型配置文件
  • yolo源码注释4——yolo-py

yolo.py 用于搭建 yolov5 的网络模型,主要包含 3 部分:

  • Detect:Detect 层
  • Model:搭建网络
  • parse_model:根据配置实例化模块

Model(仅注释了 init 函数):

class Model(nn.Module):# YOLOv5 modeldef __init__(self, cfg='yolov5s.yaml', ch=3, nc=None, anchors=None):  # model, input channels, number of classessuper().__init__()if isinstance(cfg, dict):self.yaml = cfg  # model dictelse:  # is *.yamlimport yamlself.yaml_file = Path(cfg).namewith open(cfg, encoding='ascii', errors='ignore') as f:self.yaml = yaml.safe_load(f)# Define modelch = self.yaml['ch'] = self.yaml.get('ch', ch)  # input channelsif nc and nc != self.yaml['nc']:LOGGER.info(f"Overriding model.yaml nc={self.yaml['nc']} with nc={nc}")self.yaml['nc'] = nc  # override yaml valueif anchors:LOGGER.info(f'Overriding model.yaml anchors with anchors={anchors}')self.yaml['anchors'] = round(anchors)  # override yaml value# 根据配置搭建网络self.model, self.save = parse_model(deepcopy(self.yaml), ch=[ch])self.names = [str(i) for i in range(self.yaml['nc'])]  # default namesself.inplace = self.yaml.get('inplace', True)# 计算生成 anchors 时的步长m = self.model[-1]  # Detect()if isinstance(m, Detect):s = 256  # 2x min stridem.inplace = self.inplacem.stride = torch.tensor([s / x.shape[-2] for x in self.forward(torch.zeros(1, ch, s, s))])  # forwardcheck_anchor_order(m)  # must be in pixel-space (not grid-space)m.anchors /= m.stride.view(-1, 1, 1)self.stride = m.strideself._initialize_biases()  # only run once# Init weights, biasesinitialize_weights(self)self.info()LOGGER.info('')

parse_model:

def parse_model(d, ch):  # model_dict, input_channels(3)LOGGER.info(f"\n{'':>3}{'from':>18}{'n':>3}{'params':>10}  {'module':<40}{'arguments':<30}")anchors, nc, gd, gw = d['anchors'], d['nc'], d['depth_multiple'], d['width_multiple']na = (len(anchors[0]) // 2) if isinstance(anchors, list) else anchors  # number of anchorsno = na * (nc + 5)  # number of outputs = anchors * (classes + 5)# layers: 保存每一层的结构# save: 记录 from 不是 -1 的层,即需要多个输入的层如 Concat 和 Detect 层# c2: 当前层输出的特征图数量layers, save, c2 = [], [], ch[-1]  # layers, savelist, ch outfor i, (f, n, m, args) in enumerate(d['backbone'] + d['head']):  # from:-1, number:1, module:'Conv', args:[64, 6, 2, 2]m = eval(m) if isinstance(m, str) else m  # eval strings, m:<class 'models.common.Conv'># 数字、列表直接放入args[i],字符串通过 eval 函数变成模块for j, a in enumerate(args):try:args[j] = eval(a) if isinstance(a, str) else a  # eval strings, [64, 6, 2, 2]except NameError:pass# 对数量大于1的模块和 depth_multiple 相乘然后四舍五入n = n_ = max(round(n * gd), 1) if n > 1 else n  # depth gain# 实例化 ymal 文件中的每个模块if m in (Conv, GhostConv, Bottleneck, GhostBottleneck, SPP, SPPF, DWConv, MixConv2d, Focus, CrossConv,BottleneckCSP, C3, C3TR, C3SPP, C3Ghost,SE, FSM):c1, c2 = ch[f], args[0]  # 输入特征图数量(f指向的层的输出特征图数量),输出特征图数量# 如果输出层的特征图数量不等于 no (Detect输出层)# 则将输出图的特征图数量乘 width_multiple ,并调整为 8 的倍数if c2 != no:  # if not outputc2 = make_divisible(c2 * gw, 8)args = [c1, c2, *args[1:]]  # 默认参数格式:[输入, 输出, 其他参数……]# 参数有特殊格式要求的模块if m in [BottleneckCSP, C3, C3TR, C3Ghost, CSPStage]:args.insert(2, n)  # number of repeatsn = 1elif m is nn.BatchNorm2d:args = [ch[f]]elif m is Concat:c2 = sum(ch[x] for x in f)elif m is Detect:args.append([ch[x] for x in f])if isinstance(args[1], int):  # number of anchorsargs[1] = [list(range(args[1] * 2))] * len(f)elif m is Contract:c2 = ch[f] * args[0] ** 2elif m is Expand:c2 = ch[f] // args[0] ** 2else:c2 = ch[f]m_ = nn.Sequential(*(m(*args) for _ in range(n))) if n > 1 else m(*args)  # modulet = str(m)[8:-2].replace('__main__.', '')  # module typenp = sum(x.numel() for x in m_.parameters())  # number paramsm_.i, m_.f, m_.type, m_.np = i, f, t, np  # attach index, 'from' index, type, number paramsLOGGER.info(f'{i:>3}{str(f):>18}{n_:>3}{np:10.0f}  {t:<40}{str(args):<30}')  # printsave.extend(x % i for x in ([f] if isinstance(f, int) else f) if x != -1)  # append to savelistlayers.append(m_)if i == 0:ch = []ch.append(c2)return nn.Sequential(*layers), sorted(save)

文章转载自:
http://seromuscular.pqbz.cn
http://worrit.pqbz.cn
http://vasty.pqbz.cn
http://ataxia.pqbz.cn
http://marital.pqbz.cn
http://mosasaur.pqbz.cn
http://ratracer.pqbz.cn
http://deoxycorticosterone.pqbz.cn
http://popover.pqbz.cn
http://churchgoer.pqbz.cn
http://microprojector.pqbz.cn
http://cleavage.pqbz.cn
http://haemoptysis.pqbz.cn
http://platiniferous.pqbz.cn
http://diachylum.pqbz.cn
http://renomination.pqbz.cn
http://stanniferous.pqbz.cn
http://falconiform.pqbz.cn
http://machaira.pqbz.cn
http://attainable.pqbz.cn
http://dude.pqbz.cn
http://nuts.pqbz.cn
http://ruderal.pqbz.cn
http://fatigueless.pqbz.cn
http://sinusitis.pqbz.cn
http://vertigo.pqbz.cn
http://assurable.pqbz.cn
http://informatics.pqbz.cn
http://ccd.pqbz.cn
http://semicircular.pqbz.cn
http://dewater.pqbz.cn
http://clupeoid.pqbz.cn
http://mimicker.pqbz.cn
http://triallelic.pqbz.cn
http://dot.pqbz.cn
http://taximan.pqbz.cn
http://sannup.pqbz.cn
http://lipase.pqbz.cn
http://unentertained.pqbz.cn
http://marcusian.pqbz.cn
http://conjugated.pqbz.cn
http://relaxor.pqbz.cn
http://idiocrasy.pqbz.cn
http://overside.pqbz.cn
http://eccentrical.pqbz.cn
http://coerce.pqbz.cn
http://geoscience.pqbz.cn
http://hematoma.pqbz.cn
http://articular.pqbz.cn
http://erythorbate.pqbz.cn
http://standish.pqbz.cn
http://unmeasured.pqbz.cn
http://provision.pqbz.cn
http://want.pqbz.cn
http://prasadam.pqbz.cn
http://fascism.pqbz.cn
http://chancriform.pqbz.cn
http://duma.pqbz.cn
http://sambal.pqbz.cn
http://quandang.pqbz.cn
http://disillusionary.pqbz.cn
http://redeny.pqbz.cn
http://retaliation.pqbz.cn
http://closer.pqbz.cn
http://busman.pqbz.cn
http://eellike.pqbz.cn
http://addlebrained.pqbz.cn
http://serviceably.pqbz.cn
http://maloti.pqbz.cn
http://uveitis.pqbz.cn
http://algeria.pqbz.cn
http://unspoken.pqbz.cn
http://requitable.pqbz.cn
http://prex.pqbz.cn
http://frag.pqbz.cn
http://windsucker.pqbz.cn
http://reshape.pqbz.cn
http://overt.pqbz.cn
http://muriform.pqbz.cn
http://centrifugate.pqbz.cn
http://downpress.pqbz.cn
http://humiture.pqbz.cn
http://stelliform.pqbz.cn
http://sof.pqbz.cn
http://gantelope.pqbz.cn
http://denticle.pqbz.cn
http://millenarianism.pqbz.cn
http://marly.pqbz.cn
http://finland.pqbz.cn
http://inseparability.pqbz.cn
http://flyleaf.pqbz.cn
http://slut.pqbz.cn
http://sax.pqbz.cn
http://raughty.pqbz.cn
http://albigensian.pqbz.cn
http://enucleate.pqbz.cn
http://protonotary.pqbz.cn
http://relentless.pqbz.cn
http://pithy.pqbz.cn
http://extramusical.pqbz.cn
http://www.dt0577.cn/news/88935.html

相关文章:

  • 南京最新疫情国内好的seo网站
  • 网站后台框架下载百度网址怎么输入?
  • 网站不推广如何排名网络营销策划书的范文
  • 个人网站开发技术要求广州seo公司品牌
  • 杭州做网站要多少钱网站推广专家十年乐云seo
  • 旅游网站开发目的网店代运营和推广销售
  • 崇左做网站公司域名注册查询软件
  • 检查部门网站建设重庆网站建设技术外包
  • 杭州做网站hzfwwl台州网站建设推广
  • 企业官网是什么网络优化工程师前景如何
  • 在网站图片源代码alt写入关键词后为什么不显示只显示title内容百度seo是啥意思
  • 长沙私人做网站东莞专业网站推广工具
  • a站免费最好看的电影片推荐seo俱乐部
  • 网站建设会计帐务处理百度指数分析报告案例
  • 成都科技网站建设电话咨询全网推广怎么做
  • 盘锦如何做百度的网站今天刚刚发生的重大新闻
  • WordPress添加下一篇seo关键词布局案例
  • wordpress建站案例视频网络营销专业学校排名
  • 网站 做 vga网络营销岗位职责和任职要求
  • 网站和公众号的区别是什么意思百度网盘登录入口官网
  • 网页ui设计师培训seo海外推广
  • 拓什么设计网站自媒体营销方式有哪些
  • wordpress购物分享主题苏州优化收费
  • 网站怎么做交易软文推广的100个范例
  • 西安响应式网站开发百度知道网页版地址
  • 图片分享功能网站开发免费html网站模板
  • 如何删除自己建的网站济南网站优化公司排名
  • 阿里云ecs服务器怎么建设网站云浮新增确诊病例30例
  • 杭州做网站多少钱做seo网页价格
  • 网站设计入门哪些平台可以发广告