활연개랑

[python(파이썬)] Segmentation Pixel Accuracy 본문

Python

[python(파이썬)] Segmentation Pixel Accuracy

승해tmdhey 2023. 1. 6. 10:44
반응형
def pixel_accuracy(pred_mask, gt_mask):
    pixel_labeled = np.sum(gt_mask >= 0)
    pixel_correct = np.sum((gt_mask == pred_mask)*(gt_mask >= 0))
    pixel_acc = pixel_correct*1.0/pixel_labeled
    return pixel_acc