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


Python util.GetFilesRecursively方法代码示例

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


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

示例1: main

# 需要导入模块: from utils import util [as 别名]
# 或者: from utils.util import GetFilesRecursively [as 别名]
def main(_):
  # Parse config dict from yaml config files / command line flags.
  config = util.ParseConfigsToLuaTable(FLAGS.config_paths, FLAGS.model_params)
  num_views = config.data.num_views

  validation_records = util.GetFilesRecursively(config.data.validation)
  batch_size = config.data.batch_size

  checkpointdir = FLAGS.checkpointdir

  # If evaluating a specific checkpoint, do that.
  if FLAGS.checkpoint_iter:
    checkpoint_path = os.path.join(
        '%s/model.ckpt-%s' % (checkpointdir, FLAGS.checkpoint_iter))
    evaluate_once(
        config, checkpointdir, validation_records, checkpoint_path, batch_size,
        num_views)
  else:
    for checkpoint_path in tf.contrib.training.checkpoints_iterator(
        checkpointdir):
      evaluate_once(
          config, checkpointdir, validation_records, checkpoint_path,
          batch_size, num_views) 
开发者ID:rky0930,项目名称:yolo_v2,代码行数:25,代码来源:alignment.py

示例2: evaluate

# 需要导入模块: from utils import util [as 别名]
# 或者: from utils.util import GetFilesRecursively [as 别名]
def evaluate(self):
    """Runs `Estimator` validation.
    """
    config = self._config

    # Get a list of validation tfrecords.
    validation_dir = config.data.validation
    validation_records = util.GetFilesRecursively(validation_dir)

    # Define batch size.
    self._batch_size = config.data.batch_size

    # Create a subclass-defined training input function.
    validation_input_fn = self.construct_input_fn(
        validation_records, False)

    # Create the estimator.
    estimator = self._build_estimator(is_training=False)

    # Run validation.
    eval_batch_size = config.data.batch_size
    num_eval_samples = config.val.num_eval_samples
    num_eval_batches = int(num_eval_samples / eval_batch_size)
    estimator.evaluate(input_fn=validation_input_fn, steps=num_eval_batches) 
开发者ID:rky0930,项目名称:yolo_v2,代码行数:26,代码来源:base_estimator.py

示例3: get_labeled_tables

# 需要导入模块: from utils import util [as 别名]
# 或者: from utils.util import GetFilesRecursively [as 别名]
def get_labeled_tables(config):
  """Gets either labeled test or validation tables, based on flags."""
  # Get a list of filenames corresponding to labeled data.
  mode = FLAGS.mode
  if mode == 'validation':
    labeled_tables = util.GetFilesRecursively(config.data.labeled.validation)
  elif mode == 'test':
    labeled_tables = util.GetFilesRecursively(config.data.labeled.test)
  else:
    raise ValueError('Unknown dataset: %s' % mode)
  return labeled_tables 
开发者ID:rky0930,项目名称:yolo_v2,代码行数:13,代码来源:labeled_eval.py

示例4: main

# 需要导入模块: from utils import util [as 别名]
# 或者: from utils.util import GetFilesRecursively [as 别名]
def main(_):
  # Parse config dict from yaml config files / command line flags.
  config = util.ParseConfigsToLuaTable(FLAGS.config_paths, FLAGS.model_params)

  # Get tables to embed.
  query_records_dir = FLAGS.query_records_dir
  query_records = util.GetFilesRecursively(query_records_dir)

  target_records_dir = FLAGS.target_records_dir
  target_records = util.GetFilesRecursively(target_records_dir)

  height = config.data.raw_height
  width = config.data.raw_width
  mode = FLAGS.mode
  if mode == 'multi':
    # Generate videos where target set is composed of multiple videos.
    MultiImitationVideos(query_records, target_records, config,
                         height, width)
  elif mode == 'single':
    # Generate videos where target set is a single video.
    SingleImitationVideos(query_records, target_records, config,
                          height, width)
  elif mode == 'same':
    # Generate videos where target set is the same as query, but diff view.
    SameSequenceVideos(query_records, config, height, width)
  else:
    raise ValueError('Unknown mode %s' % mode) 
开发者ID:rky0930,项目名称:yolo_v2,代码行数:29,代码来源:generate_videos.py

示例5: train

# 需要导入模块: from utils import util [as 别名]
# 或者: from utils.util import GetFilesRecursively [as 别名]
def train(self):
    """Runs training."""
    # Get a list of training tfrecords.
    config = self._config
    training_dir = config.data.training
    training_records = util.GetFilesRecursively(training_dir)

    # Define batch size.
    self._batch_size = config.data.batch_size

    # Create a subclass-defined training input function.
    train_input_fn = self.construct_input_fn(
        training_records, is_training=True)

    # Create the estimator.
    estimator = self._build_estimator(is_training=True)

    train_hooks = None
    if config.use_tpu:
      # TPU training initializes pretrained weights using a custom train hook.
      train_hooks = []
      if tf.train.latest_checkpoint(self._logdir) is None:
        train_hooks.append(
            InitFromPretrainedCheckpointHook(
                config[config.embedder_strategy].pretrained_checkpoint))

    # Run training.
    estimator.train(input_fn=train_input_fn, hooks=train_hooks,
                    steps=config.learning.max_step) 
开发者ID:rky0930,项目名称:yolo_v2,代码行数:31,代码来源:base_estimator.py


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