1. 首页
  2. 编程语言
  3. Python
  4. 图像分割结果评估方法(python)

图像分割结果评估方法(python)

上传者: 2021-05-20 00:13:49上传 .PY文件 7.17 KB 热度 41次

def calIOU(binary_GT, binary_R): row, col = binary_GT.shape # 矩阵的行与列 TP,FP,FN = 0,0,0 for i in range(row): for j in range(col): if binary_GT[i][j] == 255 and binary_R[i][j] == 255: TP = 1 if binary_GT[i][j] == 255 and binary_R[i][j] == 0: FP = 1 if binary_GT[i][j] == 0 and binary_R[i][j] == 255: FN = 1 IOU = TP / (TP FP FN)

用户评论