hkc*_*cqr 20 computer-vision image-segmentation evaluation-strategy
如何计算平均IU(平均路口过联盟)得分在这个文件?
很长,Jonathan,Evan Shelhamer和Trevor Darrell."用于语义分割的完全卷积网络."
Mik*_*iki 28
对于每个班级,交叉联盟(IU)得分为:
真阳性/(真阳性+假阳性+假阴性)
该平均IU是简单的平均值的所有类.
关于文件中的符号:
n_ij:预测属于类j的类i的像素数.因此,对于类我:
你可以找到MATLAB代码直接在Pascak的devkit计算这个位置
小智 13
from sklearn.metrics import confusion_matrix
import numpy as np
def compute_iou(y_pred, y_true):
# ytrue, ypred is a flatten vector
y_pred = y_pred.flatten()
y_true = y_true.flatten()
current = confusion_matrix(y_true, y_pred, labels=[0, 1])
# compute mean iou
intersection = np.diag(current)
ground_truth_set = current.sum(axis=1)
predicted_set = current.sum(axis=0)
union = ground_truth_set + predicted_set - intersection
IoU = intersection / union.astype(np.float32)
return np.mean(IoU)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
23243 次 |
| 最近记录: |