當前位置: 首頁>>代碼示例>>Python>>正文


Python resnet_utils.stack_blocks_dense方法代碼示例

本文整理匯總了Python中nets.resnet_utils.stack_blocks_dense方法的典型用法代碼示例。如果您正苦於以下問題:Python resnet_utils.stack_blocks_dense方法的具體用法?Python resnet_utils.stack_blocks_dense怎麽用?Python resnet_utils.stack_blocks_dense使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在nets.resnet_utils的用法示例。


在下文中一共展示了resnet_utils.stack_blocks_dense方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _resnet_plain

# 需要導入模塊: from nets import resnet_utils [as 別名]
# 或者: from nets.resnet_utils import stack_blocks_dense [as 別名]
def _resnet_plain(self, inputs, blocks, output_stride=None, scope=None):
    """A plain ResNet without extra layers before or after the ResNet blocks."""
    with tf.variable_scope(scope, values=[inputs]):
      with slim.arg_scope([slim.conv2d], outputs_collections='end_points'):
        net = resnet_utils.stack_blocks_dense(inputs, blocks, output_stride)
        end_points = slim.utils.convert_collection_to_dict('end_points')
        return net, end_points 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:9,代碼來源:resnet_v2_test.py

示例2: _extract_box_classifier_features

# 需要導入模塊: from nets import resnet_utils [as 別名]
# 或者: from nets.resnet_utils import stack_blocks_dense [as 別名]
def _extract_box_classifier_features(self, proposal_feature_maps, scope):
    """Extracts second stage box classifier features.

    Args:
      proposal_feature_maps: A 4-D float tensor with shape
        [batch_size * self.max_num_proposals, crop_height, crop_width, depth]
        representing the feature map cropped to each proposal.
      scope: A scope name (unused).

    Returns:
      proposal_classifier_features: A 4-D float tensor with shape
        [batch_size * self.max_num_proposals, height, width, depth]
        representing box classifier features for each proposal.
    """
    with tf.variable_scope(self._architecture, reuse=self._reuse_weights):
      with slim.arg_scope(
          resnet_utils.resnet_arg_scope(
              batch_norm_epsilon=1e-5,
              batch_norm_scale=True,
              weight_decay=self._weight_decay)):
        with slim.arg_scope([slim.batch_norm], is_training=False):
          blocks = [
              resnet_utils.Block('block4', resnet_v1.bottleneck, [{
                  'depth': 2048,
                  'depth_bottleneck': 512,
                  'stride': 1
              }] * 3)
          ]
          proposal_classifier_features = resnet_utils.stack_blocks_dense(
              proposal_feature_maps, blocks)
    return proposal_classifier_features 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:33,代碼來源:faster_rcnn_resnet_v1_feature_extractor.py

示例3: _extract_box_classifier_features

# 需要導入模塊: from nets import resnet_utils [as 別名]
# 或者: from nets.resnet_utils import stack_blocks_dense [as 別名]
def _extract_box_classifier_features(self, proposal_feature_maps, scope):
    """Extracts second stage box classifier features.

    Args:
      proposal_feature_maps: A 4-D float tensor with shape
        [batch_size * self.max_num_proposals, crop_height, crop_width, depth]
        representing the feature map cropped to each proposal.
      scope: A scope name (unused).

    Returns:
      proposal_classifier_features: A 4-D float tensor with shape
        [batch_size * self.max_num_proposals, height, width, depth]
        representing box classifier features for each proposal.
    """
    with tf.variable_scope(self._architecture, reuse=self._reuse_weights):
      with slim.arg_scope(
          resnet_utils.resnet_arg_scope(
              batch_norm_epsilon=1e-5,
              batch_norm_scale=True,
              weight_decay=self._weight_decay)):
        with slim.arg_scope([slim.batch_norm],
                            is_training=self._train_batch_norm):
          blocks = [
              resnet_utils.Block('block4', resnet_v1.bottleneck, [{
                  'depth': 2048,
                  'depth_bottleneck': 512,
                  'stride': 1
              }] * 3)
          ]
          proposal_classifier_features = resnet_utils.stack_blocks_dense(
              proposal_feature_maps, blocks)
    return proposal_classifier_features 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:34,代碼來源:faster_rcnn_resnet_v1_feature_extractor.py


注:本文中的nets.resnet_utils.stack_blocks_dense方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。