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


Python box_predictor_builder.build_keras方法代码示例

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


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

示例1: _get_second_stage_box_predictor

# 需要导入模块: from object_detection.builders import box_predictor_builder [as 别名]
# 或者: from object_detection.builders.box_predictor_builder import build_keras [as 别名]
def _get_second_stage_box_predictor(self,
                                      num_classes,
                                      is_training,
                                      predict_masks,
                                      masks_are_class_agnostic,
                                      share_box_across_classes=False,
                                      use_keras=False):
    box_predictor_proto = box_predictor_pb2.BoxPredictor()
    text_format.Merge(
        self._get_second_stage_box_predictor_text_proto(
            share_box_across_classes), box_predictor_proto)
    if predict_masks:
      text_format.Merge(
          self._add_mask_to_second_stage_box_predictor_text_proto(
              masks_are_class_agnostic), box_predictor_proto)

    if use_keras:
      return box_predictor_builder.build_keras(
          hyperparams_builder.KerasLayerHyperparams,
          inplace_batchnorm_update=False,
          freeze_batchnorm=False,
          box_predictor_config=box_predictor_proto,
          num_classes=num_classes,
          num_predictions_per_location_list=None,
          is_training=is_training)
    else:
      return box_predictor_builder.build(
          hyperparams_builder.build,
          box_predictor_proto,
          num_classes=num_classes,
          is_training=is_training) 
开发者ID:tensorflow,项目名称:models,代码行数:33,代码来源:context_rcnn_meta_arch_tf1_test.py

示例2: _get_second_stage_box_predictor

# 需要导入模块: from object_detection.builders import box_predictor_builder [as 别名]
# 或者: from object_detection.builders.box_predictor_builder import build_keras [as 别名]
def _get_second_stage_box_predictor(self, num_classes, is_training,
                                      predict_masks, masks_are_class_agnostic,
                                      share_box_across_classes=False,
                                      use_keras=False):
    box_predictor_proto = box_predictor_pb2.BoxPredictor()
    text_format.Merge(self._get_second_stage_box_predictor_text_proto(
        share_box_across_classes), box_predictor_proto)
    if predict_masks:
      text_format.Merge(
          self._add_mask_to_second_stage_box_predictor_text_proto(
              masks_are_class_agnostic),
          box_predictor_proto)

    if use_keras:
      return box_predictor_builder.build_keras(
          hyperparams_builder.KerasLayerHyperparams,
          inplace_batchnorm_update=False,
          freeze_batchnorm=False,
          box_predictor_config=box_predictor_proto,
          num_classes=num_classes,
          num_predictions_per_location_list=None,
          is_training=is_training)
    else:
      return box_predictor_builder.build(
          hyperparams_builder.build,
          box_predictor_proto,
          num_classes=num_classes,
          is_training=is_training) 
开发者ID:tensorflow,项目名称:models,代码行数:30,代码来源:faster_rcnn_meta_arch_test_lib.py


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