roi_pool_test.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:luminoth 作者: tryolabs 项目源码 文件源码
def setUp(self):
        super(ROIPoolingTest, self).setUp()
        # Setup
        self.im_shape = (10, 10)
        self.config = EasyDict({
            'pooling_mode': 'crop',
            'pooled_width': 2,
            'pooled_height': 2,
            'padding': 'VALID',
        })
        # Construct the pretrained map with four matrix.
        self.multiplier_a = 1
        self.multiplier_b = 2
        self.multiplier_c = 3
        self.multiplier_d = 4
        mat_a = np.ones((5, 5)) * self.multiplier_a
        mat_b = np.ones((5, 5)) * self.multiplier_b
        mat_c = np.ones((5, 5)) * self.multiplier_c
        mat_d = np.ones((5, 5)) * self.multiplier_d
        self.pretrained = np.bmat([[mat_a, mat_b], [mat_c, mat_d]])
        # Expand the dimensions to be compatible with ROIPoolingLayer.
        self.pretrained = np.expand_dims(self.pretrained, axis=0)
        self.pretrained = np.expand_dims(self.pretrained, axis=3)
        # pretrained:
        #           mat_a | mat_b
        #           -------------
        #           mat_c | mat_d
        tf.reset_default_graph()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号