point_detect_with_decay.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:Face_Point 作者: EllenSimith 项目源码 文件源码
def do_eval(sess,
            eval_correct,
            images_placeholder,
            points_placeholder,
            factors_placeholder, 
            crds_placeholder,
            width_placeholder,
            data_set):
  """Runs one evaluation against the full epoch of data.

  Args:
    sess: The session in which the model has been trained.
    eval_correct: The Tensor that returns the number of correct predictions.
    data_set: The set of images and labels to evaluate, from
      input_data.read_data_sets().
  """
  # And run one epoch of eval.
  true_count = 0  # Counts the number of correct predictions.
  steps_per_epoch = data_set.num_examples // FLAGS.batch_size
  num_examples = steps_per_epoch * FLAGS.batch_size
  for step in xrange(steps_per_epoch):
    feed_dict = fill_feed_dict(data_set,
                               images_placeholder,
                               points_placeholder,
                               factors_placeholder, 
                               crds_placeholder,
                               width_placeholder)
    true_count += sess.run(eval_correct, feed_dict=feed_dict)
  precision = true_count / num_examples
  print('  Num examples: %d  Num correct: %d  Precision @ 1: %0.04f' %
        (num_examples, true_count, precision))
  return precision
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号