朔州网站建设公司网站设计实验目的
朔州网站建设公司,网站设计实验目的,软件管理,厨具 技术支持东莞网站建设pytorch fasterrcnn-resnet50-fpn 神经网络 目标识别 应用 —— 逻辑概述 前提#xff1a;工欲善其事必先利其器一、逻辑概述1 模型训练1) 训练数据2) 网络结构 2 推理识别 [下一章 推理识别代码讲解](https://blog.csdn.net/qq_42239488/article/details/126309847)#xff… pytorch fasterrcnn-resnet50-fpn 神经网络 目标识别 应用 —— 逻辑概述 前提工欲善其事必先利其器一、逻辑概述1 模型训练1) 训练数据2) 网络结构 2 推理识别 [下一章 推理识别代码讲解](https://blog.csdn.net/qq_42239488/article/details/126309847)[开源](https://gitee.com/laomaogu/fasterrcnn_resnet50_fpn_study/tree/master) 记录神经网络学习过程,我的代码主要参照官方案例pytorh 有兴趣可以看一下 前提工欲善其事必先利其器
工具环境(我的环境配置文件 requirements.txt 已上传到 gitee 供大家参考)代码数据 网上案例很多环境搭建不再赘述代码和数据我会上传到gitee 工具看个人喜好vscode轻便pycharm 功能好,新手推荐pycharm 源码https://gitee.com/laomaogu/fasterrcnn_resnet50_fpn_study 接下来正式进入学习环节
一、逻辑概述 对于一个完全陌生的技术点 我一贯的作风是先搞清楚大概的运行逻辑 细枝末节先不管这样才能摸清主干的脉络 等到大概搞清楚啥意思了再逐一深入探讨 毕竟 , 重在 应用 今天先看看最粗的一个枝干 #mermaid-svg-Kqe3r2dbtBi6n2R8 {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .error-icon{fill:#552222;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .marker.cross{stroke:#333333;}#mermaid-svg-Kqe3r2dbtBi6n2R8 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .cluster-label text{fill:#333;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .cluster-label span{color:#333;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .label text,#mermaid-svg-Kqe3r2dbtBi6n2R8 span{fill:#333;color:#333;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .node rect,#mermaid-svg-Kqe3r2dbtBi6n2R8 .node circle,#mermaid-svg-Kqe3r2dbtBi6n2R8 .node ellipse,#mermaid-svg-Kqe3r2dbtBi6n2R8 .node polygon,#mermaid-svg-Kqe3r2dbtBi6n2R8 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .node .label{text-align:center;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .node.clickable{cursor:pointer;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .arrowheadPath{fill:#333333;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .cluster text{fill:#333;}#mermaid-svg-Kqe3r2dbtBi6n2R8 .cluster span{color:#333;}#mermaid-svg-Kqe3r2dbtBi6n2R8 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-Kqe3r2dbtBi6n2R8 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 模型训练 推理 识别 够不够简单粗暴总共就两个东西 1 模型训练
1) 训练数据
正式讲解之前我们先看一个小故事 厂里生产的水杯最近质量严重下降导致很多客户投诉 _ 老板想找个人守在产线出口监督生产 _ 招个人干他不放心这可关乎到厂子生产的质量的问题 _ 左思右想叫来了自家大侄子 _ 老板拉着大侄子到一堆水杯面前 跟他说“你看这个漏水不行。 这个掉漆不行。这个可以里外干净光滑。。。。。” _ “以后质量大关我可就交给你了好好干副厂长的位置给你留着” 言归正传 为啥要训练模型 本质上就和上边老板对大侄子说的话一样 要让大侄子明白哪个是良品哪个是不良品。
那数据是啥 显而易见那堆杯子就是数据 而且要有好的和不良的杯子做对比 有了参照大侄子就明白了 反应到神经网络里就是以下的过程 #mermaid-svg-gTLmSoGanpl834Rh {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-gTLmSoGanpl834Rh .error-icon{fill:#552222;}#mermaid-svg-gTLmSoGanpl834Rh .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-gTLmSoGanpl834Rh .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-gTLmSoGanpl834Rh .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-gTLmSoGanpl834Rh .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-gTLmSoGanpl834Rh .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-gTLmSoGanpl834Rh .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-gTLmSoGanpl834Rh .marker{fill:#333333;stroke:#333333;}#mermaid-svg-gTLmSoGanpl834Rh .marker.cross{stroke:#333333;}#mermaid-svg-gTLmSoGanpl834Rh svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-gTLmSoGanpl834Rh .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-gTLmSoGanpl834Rh .cluster-label text{fill:#333;}#mermaid-svg-gTLmSoGanpl834Rh .cluster-label span{color:#333;}#mermaid-svg-gTLmSoGanpl834Rh .label text,#mermaid-svg-gTLmSoGanpl834Rh span{fill:#333;color:#333;}#mermaid-svg-gTLmSoGanpl834Rh .node rect,#mermaid-svg-gTLmSoGanpl834Rh .node circle,#mermaid-svg-gTLmSoGanpl834Rh .node ellipse,#mermaid-svg-gTLmSoGanpl834Rh .node polygon,#mermaid-svg-gTLmSoGanpl834Rh .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-gTLmSoGanpl834Rh .node .label{text-align:center;}#mermaid-svg-gTLmSoGanpl834Rh .node.clickable{cursor:pointer;}#mermaid-svg-gTLmSoGanpl834Rh .arrowheadPath{fill:#333333;}#mermaid-svg-gTLmSoGanpl834Rh .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-gTLmSoGanpl834Rh .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-gTLmSoGanpl834Rh .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-gTLmSoGanpl834Rh .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-gTLmSoGanpl834Rh .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-gTLmSoGanpl834Rh .cluster text{fill:#333;}#mermaid-svg-gTLmSoGanpl834Rh .cluster span{color:#333;}#mermaid-svg-gTLmSoGanpl834Rh div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-gTLmSoGanpl834Rh :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 交给 生成 数据 神经网络不断学习 权重文件 xxx.pth 这个权重文件就是一个“判断标准”
模型和网络结构就像大侄子而训练出来的权重文件就像大侄子的判断标准
至于这个判断标准效果怎么样只有推理预测一下才能知道 2) 网络结构
本代码用的结构如标题所述fasterrcnn-resnet50-fpn
网络结构先不讲这部分我们只要知道不同的网络结构的特性及应用方向就OK了
当然主要是太深的我也不懂。。。。 2 推理识别
上面说了 大侄子就是模型大侄子判断标准就是训练得到的权重文件 .pth.
但是代码不像人 能完成很多高级指令 所以有些过程需要通过代码体现 #mermaid-svg-2stoYis7Vuq0mwNq {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-2stoYis7Vuq0mwNq .error-icon{fill:#552222;}#mermaid-svg-2stoYis7Vuq0mwNq .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-2stoYis7Vuq0mwNq .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-2stoYis7Vuq0mwNq .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-2stoYis7Vuq0mwNq .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-2stoYis7Vuq0mwNq .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-2stoYis7Vuq0mwNq .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-2stoYis7Vuq0mwNq .marker{fill:#333333;stroke:#333333;}#mermaid-svg-2stoYis7Vuq0mwNq .marker.cross{stroke:#333333;}#mermaid-svg-2stoYis7Vuq0mwNq svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-2stoYis7Vuq0mwNq .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-2stoYis7Vuq0mwNq .cluster-label text{fill:#333;}#mermaid-svg-2stoYis7Vuq0mwNq .cluster-label span{color:#333;}#mermaid-svg-2stoYis7Vuq0mwNq .label text,#mermaid-svg-2stoYis7Vuq0mwNq span{fill:#333;color:#333;}#mermaid-svg-2stoYis7Vuq0mwNq .node rect,#mermaid-svg-2stoYis7Vuq0mwNq .node circle,#mermaid-svg-2stoYis7Vuq0mwNq .node ellipse,#mermaid-svg-2stoYis7Vuq0mwNq .node polygon,#mermaid-svg-2stoYis7Vuq0mwNq .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-2stoYis7Vuq0mwNq .node .label{text-align:center;}#mermaid-svg-2stoYis7Vuq0mwNq .node.clickable{cursor:pointer;}#mermaid-svg-2stoYis7Vuq0mwNq .arrowheadPath{fill:#333333;}#mermaid-svg-2stoYis7Vuq0mwNq .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-2stoYis7Vuq0mwNq .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-2stoYis7Vuq0mwNq .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-2stoYis7Vuq0mwNq .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-2stoYis7Vuq0mwNq .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-2stoYis7Vuq0mwNq .cluster text{fill:#333;}#mermaid-svg-2stoYis7Vuq0mwNq .cluster span{color:#333;}#mermaid-svg-2stoYis7Vuq0mwNq div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-2stoYis7Vuq0mwNq :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 输出 加载模型结构 神经网络 加载权重文件 预 测 待推理数据 推理结果 下一章 推理识别代码讲解开源
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/89496.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!