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


Python input_reader_pb2.NUMERICAL_MASKS屬性代碼示例

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


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

示例1: testNewMaskType

# 需要導入模塊: from object_detection.protos import input_reader_pb2 [as 別名]
# 或者: from object_detection.protos.input_reader_pb2 import NUMERICAL_MASKS [as 別名]
def testNewMaskType(self):
    """Tests that mask type can be overwritten in input readers."""
    original_mask_type = input_reader_pb2.NUMERICAL_MASKS
    new_mask_type = input_reader_pb2.PNG_MASKS
    pipeline_config_path = os.path.join(self.get_temp_dir(), "pipeline.config")

    pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
    train_input_reader = pipeline_config.train_input_reader
    train_input_reader.mask_type = original_mask_type
    eval_input_reader = pipeline_config.eval_input_reader.add()
    eval_input_reader.mask_type = original_mask_type
    _write_config(pipeline_config, pipeline_config_path)

    configs = config_util.get_configs_from_pipeline_file(pipeline_config_path)
    override_dict = {"mask_type": new_mask_type}
    configs = config_util.merge_external_params_with_configs(
        configs, kwargs_dict=override_dict)
    self.assertEqual(new_mask_type, configs["train_input_config"].mask_type)
    self.assertEqual(new_mask_type, configs["eval_input_configs"][0].mask_type) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:21,代碼來源:config_util_test.py

示例2: testUpdateMaskTypeForAllInputConfigs

# 需要導入模塊: from object_detection.protos import input_reader_pb2 [as 別名]
# 或者: from object_detection.protos.input_reader_pb2 import NUMERICAL_MASKS [as 別名]
def testUpdateMaskTypeForAllInputConfigs(self):
    original_mask_type = input_reader_pb2.NUMERICAL_MASKS
    new_mask_type = input_reader_pb2.PNG_MASKS

    pipeline_config_path = os.path.join(self.get_temp_dir(), "pipeline.config")
    pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
    train_config = pipeline_config.train_input_reader
    train_config.mask_type = original_mask_type
    eval_1 = pipeline_config.eval_input_reader.add()
    eval_1.mask_type = original_mask_type
    eval_1.name = "eval_1"
    eval_2 = pipeline_config.eval_input_reader.add()
    eval_2.mask_type = original_mask_type
    eval_2.name = "eval_2"
    _write_config(pipeline_config, pipeline_config_path)

    configs = config_util.get_configs_from_pipeline_file(pipeline_config_path)
    override_dict = {"mask_type": new_mask_type}
    configs = config_util.merge_external_params_with_configs(
        configs, kwargs_dict=override_dict)

    self.assertEqual(configs["train_input_config"].mask_type, new_mask_type)
    for eval_input_config in configs["eval_input_configs"]:
      self.assertEqual(eval_input_config.mask_type, new_mask_type) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:26,代碼來源:config_util_test.py

示例3: testNewMaskType

# 需要導入模塊: from object_detection.protos import input_reader_pb2 [as 別名]
# 或者: from object_detection.protos.input_reader_pb2 import NUMERICAL_MASKS [as 別名]
def testNewMaskType(self):
    """Tests that mask type can be overwritten in input readers."""
    original_mask_type = input_reader_pb2.NUMERICAL_MASKS
    new_mask_type = input_reader_pb2.PNG_MASKS
    pipeline_config_path = os.path.join(self.get_temp_dir(), "pipeline.config")

    pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
    train_input_reader = pipeline_config.train_input_reader
    train_input_reader.mask_type = original_mask_type
    eval_input_reader = pipeline_config.eval_input_reader
    eval_input_reader.mask_type = original_mask_type
    _write_config(pipeline_config, pipeline_config_path)

    configs = config_util.get_configs_from_pipeline_file(pipeline_config_path)
    configs = config_util.merge_external_params_with_configs(
        configs, mask_type=new_mask_type)
    self.assertEqual(new_mask_type, configs["train_input_config"].mask_type)
    self.assertEqual(new_mask_type, configs["eval_input_config"].mask_type) 
開發者ID:cagbal,項目名稱:ros_people_object_detection_tensorflow,代碼行數:20,代碼來源:config_util_test.py


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