当前位置:网站首页>Points for attention in adding spp module to the network
Points for attention in adding spp module to the network
2022-07-24 05:49:00 【Hehai CV chicken with vegetables】
spp The module draws on the idea of spatial pyramid , adopt SPP The module realizes the fusion of local features and global features , Enriching the expression ability of feature map , It is beneficial to the case that the target size difference in the image to be detected is large , Therefore, the accuracy of detection has been greatly improved . There's a lot of yolov3 The version of has been added spp modular , So I'm also in my yolov3(bubbliiiing edition ) Try to add spp modular . The specific code is as follows :
class SPPBottleneck(nn.Module):
"""Spatial pyramid pooling layer used in YOLOv3-SPP"""
def __init__(
self, in_channels, out_channels, kernel_sizes=(5, 9, 13)
):
super().__init__()
hidden_channels = in_channels // 2
self.conv1 = nn.Sequential(nn.Conv2d(in_channels, hidden_channels, 1, stride=1),
nn.ReLU(),
nn.BatchNorm2d(hidden_channels)
)
self.m = nn.ModuleList(
[
nn.MaxPool2d(kernel_size=ks, stride=1, padding=ks // 2)
for ks in kernel_sizes
]
)
conv2_channels = hidden_channels * (len(kernel_sizes) + 1)
self.conv2 = nn.Sequential(nn.Conv2d(conv2_channels, out_channels, 1, stride=1),
nn.ReLU(),
nn.BatchNorm2d(out_channels)
)
def forward(self, x):
x = self.conv1(x)
x = torch.cat([x] + [m(x) for m in self.m], dim=1)
x = self.conv2(x)
return x
Where the input and output are darknet Output of the last convolution layer in channel, these two items. channel It's the same size .
On the Internet body Add self.spp
self.spp = SPPBottleneck(1024,1024)
And then darknet First output load spp Module
x0 = self.spp(x0)
Besides , There is a small problem in adding the network , Forget to join bn The layer , Lead to loss stay in a high position without going down , Another small detail , Xi xi xi .
边栏推荐
- 国内外知名源码商城系统盘点
- Multi merchant mall system function disassembly lecture 08 - platform end commodity classification
- Multi merchant mall system function disassembly Lecture 11 - platform side commodity column
- Zotero快速上手指南
- 多商户商城系统功能拆解09讲-平台端商品品牌
- SqlServer 完全删除
- [vSphere high availability] host failover
- Multi merchant mall system function disassembly lecture 12 - platform side commodity evaluation
- 对接CRM系统和效果类广告,助力企业精准营销助力企业精准营销
- [activiti] activiti introduction
猜你喜欢

likeshop单商户商城系统搭建,代码开源无加密

The female colleague of the company asked me to go to her residence to repair the computer at 11 o'clock at night. It turned out that disk C was popular. Look at my move to fix the female colleague's

学习率余弦退火衰减之后的loss

《统计学习方法(第2版)》李航 第十三章 无监督学习概论 思维导图笔记

多商户商城系统功能拆解10讲-平台端商品单位

《机器学习》(周志华) 第3章 线性模型 学习心得 笔记

程序员常说的API是什么意思?API类型有什么呢?

likeshop单商户SAAS商城系统无限多开

The SaaS mall system of likeshop single merchant is built, and the code is open source without encryption.

【activiti】网关
随机推荐
spark 广播变量和累加器使用和原理
Subsystem technology and ecology may memorabilia | square one plan launched, Boca launched xcm!
【activiti】网关
《机器学习》(周志华) 第3章 线性模型 学习心得 笔记
likeshop单商户商城系统搭建,代码开源无加密
多商户商城系统功能拆解11讲-平台端商品栏目
Read "Enlightenment: a 20-year career experience of an IT executive"
ERP+RPA 打通企业信息孤岛,企业效益加倍提升
Zotero快速上手指南
Official account development custom menu and server configuration are enabled at the same time
多商户商城系统功能拆解12讲-平台端商品评价
‘Results do not correspond to current coco set‘
likeshop | 单商户商城系统代码开源无加密-PHP
统计信号处理小作业——瑞利分布噪声中确定性直流信号的检测
《统计学习方法(第2版)》李航 第14章 聚类方法 思维导图笔记 及 课后习题答案(步骤详细) k-均值 层次聚类 第十四章
Multi merchant mall system function disassembly lecture 07 - platform side commodity management
Logical structure of Oracle Database
Small operation of statistical signal processing -- detection of deterministic DC signal in Rayleigh distributed noise
达梦数据库_在使用过程中的需要注意的小事项
[vSphere high availability] virtual machine reset and restart