NME评价指标
- NME
- FR
- CED
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/1d3cf8226d9fac08beedea482e40beb6.png)
- NME计算代码:
base = np.linalg.norm(gt_pts[36] - gt_pts[45])
def nme(pred_pts, gt_pts, base):
return np.mean(np.linalg.norm(pred_pts - gt_pts, axis = 1) / base
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import simps
def AUCError(errors, failureThreshold=0.08, step=0.0001, showCurve=False):
nErrors = len(errors)
xAxis = list(np.arange(0., failureThreshold + step, step))
ced = [float(np.count_nonzero([errors <= x])) / nErrors for x in xAxis]
AUC = simps(ced, x=xAxis) / failureThreshold
failureRate = 1. - ced[-1]
print("AUC @ {0}: {1}".format(failureThreshold, AUC))
print("Failure rate: {0}".format(failureRate))
if showCurve:
plt.plot(xAxis, ced)
plt.show()