faster rcnn中的roi-pooling层

 本文就faster rcnn中的ZF网络来对roi-pooling层做一个解读
 首先看网络结构,
 layer {

name: “roi_pool_conv5”
type: “ROIPooling”
bottom: “conv5”
bottom: “rois”
top: “roi_pool_conv5”
roi_pooling_param {
pooled_w: 6
pooled_h: 6
spatial_scale: 0.0625 # 1/16
}
}
其bottom[0]就是conv5出来的feature map(长和宽分别是原始图片的1/16),bottom[1]是rois(是一个blob)。
其中,top的形状是(bottom[1]->num(), channels_, pooled_height_,pooled_width_)。
其中,channels是bottom[0]的channel,pool_height_和pooled_width_都是固定的,等于6。
下面来看rio-pooling层是怎么实现的。代码见roi_pooling_layer.cpp中的Forward_cpu部分。
首先确定top的长度和宽度。我们可以将bottom[1]看成一个二维的矩阵。矩阵的行数是num_rois = bottom[1]->num(),矩阵的列数是5。(For each ROI R = [batch_index x1 y1 x2 y2]: max pool over R),这每行的5个参数代表的意思是,batch_index(也就是bottom_rois[0])确定每次在bottom[0]中的第一个维度的偏移量。其它四个参数确定在feature map中的点的坐标。现详述如下:
在feature map中,首先确定2个坐标(x1/16,y1/16),(x2/16,y2/16)。这两个点(左上,右下)就在feature map上确定了一个区域。
然后将这个区域36等分(6x6),划分成了36个相同大小的子区域。然后找出每个子区

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值