run_FCN.py 文件源码

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

项目:semantic-segmentation 作者: albertbuchard 项目源码 文件源码
def F1(tested, truth):
    tested = (tested-0.5)*2
    truth = (truth-0.5)*2
    truth[truth<=0] = -1.
    truth[truth>0] = 1.
    res  = tested+truth
    true_pos = np.size(np.where(res==2))/2.
    pos = np.size(np.where(truth ==1))/2.
    found_pos = np.size(np.where(tested ==1))/2.
    precision = true_pos/found_pos
    recall = true_pos/pos
    F1 = 2.*precision*recall/(precision+recall)
    return F1





# PRE-PROCESSING FUNCTIONS 

# TRAINING SET FUNCTIONS
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号