metrics.py 文件源码

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

项目:seglink 作者: dengdan 项目源码 文件源码
def precision_recall(num_gbboxes, tp, fp, scope=None):
    """Compute precision and recall from true positives and false
    positives booleans arrays
    """

    # Sort by score.
    with tf.name_scope(scope, 'precision_recall'):
        # Computer recall and precision.
        tp = tf.reduce_sum(tf.cast(tp, tf.float32), axis=0)
        fp = tf.reduce_sum(tf.cast(fp, tf.float32), axis=0)
        recall = tfe_math.safe_divide(tp, tf.cast(num_gbboxes, tf.float32), 'recall')
        precision = tfe_math.safe_divide(tp, tp + fp, 'precision')
        return tf.tuple([precision, recall])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号