首先看流程图
这里的原始图片经过conv layer提取出特征图,这个conv layer可以为vgg16或者其他卷积网络,然后特征图流向两个通道,一个是RPN(region proposal network),先看这个分支
anchor有两个参数,看代码(我拿的这个实现代码不好,很多地方匪夷所思装神弄鬼)
首先,从前边传来两个anchor的参数
def calc_rpn(C, img_data, width, height, resized_width, resized_height): downscale = float(C.rpn_stride)
anchor_sizes = C.anchor_box_scales anchor_ratios = C.anchor_box_ratios
# anchor box scales self.anchor_box_scales = [64, 128, 256, 512] # anchor box ratios self.anchor_box_ratios = [[1, 1], [1, 2], [2, 1]]在config文件中可见anchor的默认设置(但我看有的文章上写默认设置的scales为128,256,512三种,这里有四种)