【发布时间】:2020-08-17 22:03:29
【问题描述】:
预测图像和gt图像是黑白图像。
地面实况图像中的白点代表地面实况值。 预测图像中的白点代表预测点。
两个图像都由图像上的多行组成(存在许多行。它们都属于一个类)
我使用下面的方法
n_gt_pixels = cv2.countNonZero(im_gt) #count number of white pixels in gt image
n_predicted_pixels = 0
for i in range(rows):
for j in range(cols):
if((im_predicted[i,j] == im_gt[i,j]) and im_gt[i,j]!=0): #ignore black pixels
n_predicted_pixels = n_predicted_pixels + 1
accuracy = n_predicted_pixels /n_gt_pixels
然后我取平均值。
您能否告诉我这是否是评估模型的正确方法? 有没有更好的方法来做到这一点? (这种方法需要很多时间)
【问题讨论】:
标签: python opencv machine-learning neural-network computer-vision