當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。