本文主要是介绍YOLOv3配置文件源码详解,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
YOLOv3的配置文件,其中需要注意的是数据增强的方式,有两个,一个是
角度旋转+饱和度+曝光量+色调,外加jitter,随即调整宽高比的范围。之后需要注意的就是
3个尺度的box的mask。后续要知道他们是怎么整合起来的
[net]
# Testing
# batch=1
# subdivisions=1
# Training
batch=64 #训练样本样本数
subdivisions=16 #net->batch /= subdivisions
width=416
height=416
channels=3
momentum=0.9 #动量
decay=0.0005 #权重衰减正则化
angle=0 #旋转角度数据增强
saturation = 1.5 #饱和度数据增强
exposure = 1.5 #调整曝光量数据增强
hue=.1 #调整色调数据增强learning_rate=0.001 #学习率决定权值更新的速度
#在迭代次数小于burn_in时,其学习率更新方式有一种,大于burn_in,采用policyburn_in=1000
max_batches = 50200 #迭代停止次数
policy=steps #学习率更新策略
steps=40000,45000 #steps更新策略
scales=.1,.1[convolutional]
batch_normalize=1 #是否进行BN处理
filters=32 #卷积核个数,输出个数
size=3 #卷积核尺寸
stride=1
pad=1
activation=leaky
#卷积核3*3配合padding步长为1,不改变feature map大小,padding为2,改变原来一半大小# Downsample
[convolutional]
batch_normalize=1
filters=64
size=3
stride=2
pad=1
activation=leaky #网络层激活函数[convolutional]
batch_normalize=1
filters=32
size=1
stride=1
pad=1
activation=leaky[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky[shortcut]
from=-3
activation=linear# Downsample
[convolutional]
batch_normalize=1
filters=128
size=3
stride=2
pad=1
activation=leaky[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=leaky[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky[shortcut]
from=-3 #表示前面3层,就是Resnet
activation=linear #激活函数[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=leaky[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky[shortcut]
from=-3
activation=linear# Downsample
[convolutional]
batch_normalize=1
filters=256
size=3
stride=2
pad=1
activation=leaky[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky。。。中间重复的conv。。。[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=1024
activation=leaky[convolutional]
size=1
stride=1
pad=1
filters=75
#filters = num*(classed+5),5的意义就是4个坐标+置信度,num表示yolo中每个cell预测的框的个数,为3,voc数据集是20类,coco数据集是80类
activation=linear[yolo]
mask = 6,7,8 #不同尺度的大小对应的anchor的索引。
# anchor的大小anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326
classes=20
num=9 #每个grid cell总共预测几个box,和anchors的数量一致。
jitter=.3 #数据增强手段:jitter为随机调整宽高比的范围。
ignore_thresh = .5 #参与计算的IOU阈值大小,当预测的检测框与ground truth的IOU大于ignore_thre的时候,参与loss的计算,否则检测框不参与损失计算。
truth_thresh = 1
random=1#路由层可以包含一个或者两个值的属性,当属性只有一个值时,它输出由该索引的图层的特征图,,示例中为-4,因此路由层将从route层输出倒数的第4层的特征图。
[route]
layers = -4[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky[upsample]
stride=2#当属性有两个值时,它会返回由其值所索引的层的拼接特征图,-1和61,并且路由层将输出前一层(-1)和第61层的特征图,沿深度维度拼接。
[route]
layers = -1, 61[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=leaky[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=leaky[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=leaky[convolutional]
size=1
stride=1
pad=1
filters=75
activation=linear[yolo]
mask = 3,4,5
anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326
classes=20
num=9
jitter=.3
ignore_thresh = .5
truth_thresh = 1
random=1[route]
layers = -4[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky[upsample]
stride=2[route]
layers = -1, 36[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=256
activation=leaky[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=256
activation=leaky[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=256
activation=leaky[convolutional]
size=1
stride=1
pad=1
filters=75
activation=linear#anchors有9个,但是只有带mask标签的用上了,这里的mask=0,1,2意味着,第一,第二,第三个anchors被使用了,每个cell预测3个boxes,总共我们的检测网络有3个尺度,总共9个anchors。
[yolo]
mask = 0,1,2
anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326
classes=20
num=9
jitter=.3
ignore_thresh = .5
truth_thresh = 1
random=1
这篇关于YOLOv3配置文件源码详解的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!