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


Python inputs.create_eval_input_fn方法代码示例

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


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

示例1: _assert_model_fn_for_predict

# 需要导入模块: from object_detection import inputs [as 别名]
# 或者: from object_detection.inputs import create_eval_input_fn [as 别名]
def _assert_model_fn_for_predict(self, configs):
    model_config = configs['model']

    with tf.Graph().as_default():
      features, _ = _make_initializable_iterator(
          inputs.create_eval_input_fn(configs['eval_config'],
                                      configs['eval_input_config'],
                                      configs['model'])()).get_next()
      detection_model_fn = functools.partial(
          model_builder.build, model_config=model_config, is_training=False)

      hparams = model_hparams.create_hparams(
          hparams_overrides='load_pretrained=false')

      model_fn = model_lib.create_model_fn(detection_model_fn, configs, hparams)
      estimator_spec = model_fn(features, None, tf.estimator.ModeKeys.PREDICT)

      self.assertIsNone(estimator_spec.loss)
      self.assertIsNone(estimator_spec.train_op)
      self.assertIsNotNone(estimator_spec.predictions)
      self.assertIsNotNone(estimator_spec.export_outputs)
      self.assertIn(tf.saved_model.signature_constants.PREDICT_METHOD_NAME,
                    estimator_spec.export_outputs) 
开发者ID:ahmetozlu,项目名称:vehicle_counting_tensorflow,代码行数:25,代码来源:model_lib_test.py

示例2: _assert_outputs_for_predict

# 需要导入模块: from object_detection import inputs [as 别名]
# 或者: from object_detection.inputs import create_eval_input_fn [as 别名]
def _assert_outputs_for_predict(self, configs):
    model_config = configs['model']

    with tf.Graph().as_default():
      features, _ = inputs.create_eval_input_fn(
          configs['eval_config'],
          configs['eval_input_config'],
          configs['model'])()
      detection_model_fn = functools.partial(
          model_builder.build, model_config=model_config, is_training=False)

      hparams = model_hparams.create_hparams(
          hparams_overrides='load_pretrained=false')

      model_fn = model.create_model_fn(detection_model_fn, configs, hparams)
      estimator_spec = model_fn(features, None, tf.estimator.ModeKeys.PREDICT)

      self.assertIsNone(estimator_spec.loss)
      self.assertIsNone(estimator_spec.train_op)
      self.assertIsNotNone(estimator_spec.predictions)
      self.assertIsNotNone(estimator_spec.export_outputs)
      self.assertIn(tf.saved_model.signature_constants.PREDICT_METHOD_NAME,
                    estimator_spec.export_outputs) 
开发者ID:cagbal,项目名称:ros_people_object_detection_tensorflow,代码行数:25,代码来源:model_test.py

示例3: _assert_model_fn_for_predict

# 需要导入模块: from object_detection import inputs [as 别名]
# 或者: from object_detection.inputs import create_eval_input_fn [as 别名]
def _assert_model_fn_for_predict(self, configs):
    model_config = configs['model']

    with tf.Graph().as_default():
      features, _ = inputs.create_eval_input_fn(
          configs['eval_config'],
          configs['eval_input_config'],
          configs['model'])()
      detection_model_fn = functools.partial(
          model_builder.build, model_config=model_config, is_training=False)

      hparams = model_hparams.create_hparams(
          hparams_overrides='load_pretrained=false')

      model_fn = model_lib.create_model_fn(detection_model_fn, configs, hparams)
      estimator_spec = model_fn(features, None, tf.estimator.ModeKeys.PREDICT)

      self.assertIsNone(estimator_spec.loss)
      self.assertIsNone(estimator_spec.train_op)
      self.assertIsNotNone(estimator_spec.predictions)
      self.assertIsNotNone(estimator_spec.export_outputs)
      self.assertIn(tf.saved_model.signature_constants.PREDICT_METHOD_NAME,
                    estimator_spec.export_outputs) 
开发者ID:ambakick,项目名称:Person-Detection-and-Tracking,代码行数:25,代码来源:model_lib_test.py

示例4: _assert_outputs_for_predict

# 需要导入模块: from object_detection import inputs [as 别名]
# 或者: from object_detection.inputs import create_eval_input_fn [as 别名]
def _assert_outputs_for_predict(self, configs):
        model_config = configs['model']

        with tf.Graph().as_default():
            features, _ = inputs.create_eval_input_fn(
                configs['eval_config'],
                configs['eval_input_config'],
                configs['model'])()
            detection_model_fn = functools.partial(
                model_builder.build, model_config=model_config, is_training=False)

            hparams = model_hparams.create_hparams(
                hparams_overrides='load_pretrained=false')

            model_fn = model.create_model_fn(
                detection_model_fn, configs, hparams)
            estimator_spec = model_fn(
                features, None, tf.estimator.ModeKeys.PREDICT)

            self.assertIsNone(estimator_spec.loss)
            self.assertIsNone(estimator_spec.train_op)
            self.assertIsNotNone(estimator_spec.predictions)
            self.assertIsNotNone(estimator_spec.export_outputs)
            self.assertIn(tf.saved_model.signature_constants.PREDICT_METHOD_NAME,
                          estimator_spec.export_outputs) 
开发者ID:scorelab,项目名称:Elphas,代码行数:27,代码来源:model_test.py

示例5: test_error_with_bad_eval_config

# 需要导入模块: from object_detection import inputs [as 别名]
# 或者: from object_detection.inputs import create_eval_input_fn [as 别名]
def test_error_with_bad_eval_config(self):
    """Tests that a TypeError is raised with improper eval config."""
    configs = _get_configs_for_model('ssd_inception_v2_pets')
    configs['model'].ssd.num_classes = 37
    eval_input_fn = inputs.create_eval_input_fn(
        eval_config=configs['train_config'],  # Expecting `EvalConfig`.
        eval_input_config=configs['eval_input_configs'][0],
        model_config=configs['model'])
    with self.assertRaises(TypeError):
      eval_input_fn() 
开发者ID:ahmetozlu,项目名称:vehicle_counting_tensorflow,代码行数:12,代码来源:inputs_test.py

示例6: test_error_with_bad_eval_input_config

# 需要导入模块: from object_detection import inputs [as 别名]
# 或者: from object_detection.inputs import create_eval_input_fn [as 别名]
def test_error_with_bad_eval_input_config(self):
    """Tests that a TypeError is raised with improper eval input config."""
    configs = _get_configs_for_model('ssd_inception_v2_pets')
    configs['model'].ssd.num_classes = 37
    eval_input_fn = inputs.create_eval_input_fn(
        eval_config=configs['eval_config'],
        eval_input_config=configs['model'],  # Expecting `InputReader`.
        model_config=configs['model'])
    with self.assertRaises(TypeError):
      eval_input_fn() 
开发者ID:ahmetozlu,项目名称:vehicle_counting_tensorflow,代码行数:12,代码来源:inputs_test.py

示例7: test_error_with_bad_eval_model_config

# 需要导入模块: from object_detection import inputs [as 别名]
# 或者: from object_detection.inputs import create_eval_input_fn [as 别名]
def test_error_with_bad_eval_model_config(self):
    """Tests that a TypeError is raised with improper eval model config."""
    configs = _get_configs_for_model('ssd_inception_v2_pets')
    configs['model'].ssd.num_classes = 37
    eval_input_fn = inputs.create_eval_input_fn(
        eval_config=configs['eval_config'],
        eval_input_config=configs['eval_input_configs'][0],
        model_config=configs['eval_config'])  # Expecting `DetectionModel`.
    with self.assertRaises(TypeError):
      eval_input_fn() 
开发者ID:ahmetozlu,项目名称:vehicle_counting_tensorflow,代码行数:12,代码来源:inputs_test.py

示例8: test_error_with_bad_eval_config

# 需要导入模块: from object_detection import inputs [as 别名]
# 或者: from object_detection.inputs import create_eval_input_fn [as 别名]
def test_error_with_bad_eval_config(self):
    """Tests that a TypeError is raised with improper eval config."""
    configs = _get_configs_for_model('ssd_inception_v2_pets')
    configs['model'].ssd.num_classes = 37
    eval_input_fn = inputs.create_eval_input_fn(
        eval_config=configs['train_config'],  # Expecting `EvalConfig`.
        eval_input_config=configs['eval_input_config'],
        model_config=configs['model'])
    with self.assertRaises(TypeError):
      eval_input_fn() 
开发者ID:cagbal,项目名称:ros_people_object_detection_tensorflow,代码行数:12,代码来源:inputs_test.py

示例9: test_error_with_bad_eval_model_config

# 需要导入模块: from object_detection import inputs [as 别名]
# 或者: from object_detection.inputs import create_eval_input_fn [as 别名]
def test_error_with_bad_eval_model_config(self):
    """Tests that a TypeError is raised with improper eval model config."""
    configs = _get_configs_for_model('ssd_inception_v2_pets')
    configs['model'].ssd.num_classes = 37
    eval_input_fn = inputs.create_eval_input_fn(
        eval_config=configs['eval_config'],
        eval_input_config=configs['eval_input_config'],
        model_config=configs['eval_config'])  # Expecting `DetectionModel`.
    with self.assertRaises(TypeError):
      eval_input_fn() 
开发者ID:cagbal,项目名称:ros_people_object_detection_tensorflow,代码行数:12,代码来源:inputs_test.py


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