def preprocess(self, resized, landmarks):
#ret = resized.astype('f4')
#ret -= self.mean
#ret /= (1.e-6+ self.std)
#return ret, (landmarks/40.)-0.5
grayImg = cv2.cvtColor(resized, cv2.COLOR_BGR2GRAY).astype('f4')
m, s = cv2.meanStdDev(grayImg)
grayImg = (grayImg-m)/(1.e-6 + s)
return grayImg, landmarks/60.
评论列表
文章目录