当前位置: 首页>>代码示例>>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;未经允许,请勿转载。