当前位置: 首页>>代码示例>>Python>>正文


Python cfg.POOLING_MODE属性代码示例

本文整理汇总了Python中model.config.cfg.POOLING_MODE属性的典型用法代码示例。如果您正苦于以下问题:Python cfg.POOLING_MODE属性的具体用法?Python cfg.POOLING_MODE怎么用?Python cfg.POOLING_MODE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在model.config.cfg的用法示例。


在下文中一共展示了cfg.POOLING_MODE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _predict

# 需要导入模块: from model.config import cfg [as 别名]
# 或者: from model.config.cfg import POOLING_MODE [as 别名]
def _predict(self, net_conv):  
    # This is just _build_network in tf-faster-rcnn
   # torch.backends.cudnn.benchmark = False
   # net_conv = self._image_to_head()
    
    
    '''
        ROI pooling on SELECTIVE SEARCH boxes
    '''
    if cfg.POOLING_MODE == 'crop':
      pool5 = self._crop_pool_layer(net_conv, self._boxes)
    else:
      pool5 = self._roi_pool_layer(net_conv, self._boxes)

    if self._mode == 'TRAIN':
      torch.backends.cudnn.benchmark = True # benchmark because now the input size are fixed
    fc7 = self._head_to_tail(pool5)

    cls_prob, bbox_prob, fuse_prob, image_prob = self._region_classification(fc7)

#    for k in self._predictions.keys():
#      self._score_summaries[k] = self._predictions[k]
    self._score_summaries['image_prob'] = self._predictions['image_prob']
    #print(id(net_conv))
    return fuse_prob
#    return net_conv, cls_prob, bbox_prob, fuse_prob, image_prob 
开发者ID:Sunarker,项目名称:Collaborative-Learning-for-Weakly-Supervised-Object-Detection,代码行数:28,代码来源:network.py

示例2: _predict

# 需要导入模块: from model.config import cfg [as 别名]
# 或者: from model.config.cfg import POOLING_MODE [as 别名]
def _predict(self):
    # This is just _build_network in tf-faster-rcnn
    torch.backends.cudnn.benchmark = False
    net_conv = self._image_to_head()

    # build the anchors for the image
    if cfg.FPN:
      self._anchor_component_fpn(net_conv)
      rois = self._region_proposal_fpn(net_conv)
      pool5 = self._crop_pool_layer_fpn(net_conv, rois)
      pool5 = pool5.view(pool5.size(0),-1)
    else:
      self._anchor_component(net_conv.size(2), net_conv.size(3))
      rois = self._region_proposal(net_conv)

      if cfg.POOLING_MODE == 'crop':
        pool5 = self._crop_pool_layer(net_conv, rois)
      else:
        pool5 = self._roi_pool_layer(net_conv, rois)

    if self._mode == 'TRAIN':
      torch.backends.cudnn.benchmark = True # benchmark because now the input size are fixed
    fc7 = self._head_to_tail(pool5)

    cls_prob, bbox_pred = self._region_classification(fc7)

    for k in self._predictions.keys():
      self._score_summaries[k] = self._predictions[k]

    return rois, cls_prob, bbox_pred 
开发者ID:yxgeee,项目名称:pytorch-FPN,代码行数:32,代码来源:network.py

示例3: _build_network

# 需要导入模块: from model.config import cfg [as 别名]
# 或者: from model.config.cfg import POOLING_MODE [as 别名]
def _build_network(self, is_training=True):
    # select initializers
    if cfg.TRAIN.TRUNCATED:
      initializer = tf.truncated_normal_initializer(mean=0.0, stddev=0.01)
      initializer_bbox = tf.truncated_normal_initializer(mean=0.0, stddev=0.001)
    else:
      initializer = tf.random_normal_initializer(mean=0.0, stddev=0.01)
      initializer_bbox = tf.random_normal_initializer(mean=0.0, stddev=0.001)

    net_conv = self._image_to_head(is_training)
    with tf.variable_scope(self._scope, self._scope):
      # build the anchors for the image
      self._anchor_component()
      # region proposal network
      rois = self._region_proposal(net_conv, is_training, initializer)
      # region of interest pooling
      if cfg.POOLING_MODE == 'crop':
        pool5 = self._crop_pool_layer(net_conv, rois, "pool5")
      else:
        raise NotImplementedError

    fc7 = self._head_to_tail(pool5, is_training)
    with tf.variable_scope(self._scope, self._scope):
      # region classification
      cls_prob, bbox_pred = self._region_classification(fc7, is_training, 
                                                        initializer, initializer_bbox)

    self._score_summaries.update(self._predictions)

    return rois, cls_prob, bbox_pred 
开发者ID:endernewton,项目名称:tf-faster-rcnn,代码行数:32,代码来源:network.py


注:本文中的model.config.cfg.POOLING_MODE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。