参考https://github.com/balancap/SSD-Tensorflow 记录SSD中与bbox prediction相关的(超)参数。
ssd_vgg_300.py
SSDParameters(
img_shape=(300, 300),
num_classes=21,
no_annotation_label=21,
feat_layers=['block4', 'block7', 'block8', 'block9', 'block10', 'block11'],
feat_shapes=[(38, 38), (19, 19), (10, 10), (5, 5), (3, 3), (1, 1)],
anchor_size_bounds=[0.15, 0.9],
anchor_sizes=[(21.0, 45.0), (45.0, 99.0), (99.0, 153.0), (153.0, 207.0), (207.0, 261.0), (261.0, 315.0)],
anchor_ratios=[[2, 0.5], [2, 0.5, 3, 0.3333333333333333], [2, 0.5, 3, 0.3333333333333333], [2, 0.5, 3, 0.3333333333333333], [2, 0.5], [2, 0.5]],
anchor_steps=[8, 16, 32, 64, 100, 300],
anchor_offset=0.5,
normalizations=[20, -1, -1, -1, -1, -1],
prior_scaling=[0.1, 0.1, 0.2, 0.2]
)
image_size
SSD中没有全连接层, 可适应各种大小的图片。指定图片大小的目的是为了方便成batch训练。
num_classes
待检测的物体类别数量, 一般还需要加上背景类。
no_annotation_label
没用
feat_layers
特征层。使用哪几层来预测bbox
feat_shapes
特征层的shape
anchor_size_bounds
每个特性层上的anchor大小都不一样, 越靠近输入的层其anchor越小。
确定第一个与最后一个feature层的anchor大小以后, 处于中间的层的anchor大小则通过线性插值计算而来。例如,假如anchor_size_bounds = [0.2, 0.7]
, 有6个feature layer,则每个layer对应的default anchor大小为:[0.2, 0.3, 0.4, 0.5, 0.6, 0.7]
.
anchor_sizes
这个不是超参数。
它是论文中 s′