# {'landmark_3d_68': ,
# 'detection': ,
# 'recognition': }
// 鼻尖 30
// 鼻根 27
// 下巴 8
// 左眼外角 36
// 左眼内角 39
// 右眼外角 45
// 右眼内角 42
// 嘴中心 66
// 嘴左角 48
// 嘴右角 54
// 左脸最外 0
// 右脸最外 16
36/45/30/48/54


def get(self, img, max_num=0):
bboxes, kpss = self.det_model.detect(img,
max_num=max_num,
metric='default')
if bboxes.shape[0] == 0:
return []
ret = []
for i in range(bboxes.shape[0]):
bbox = bboxes[i, 0:4]
det_score = bboxes[i, 4]
# kps = None
# if kpss is not None:
# kps = kpss[i]
face = Face(bbox=bbox, kps=None, det_score=det_score)
self.models['landmark_3d_68'].get(img, face)
face['kps'] = face.kps = np.array([face.landmark_3d_68[i][:-1] for i in [36, 45, 30, 48, 54]])
self.models['recognition'].get(img, face)
# for taskname, model in self.models.items():
# if taskname=='detection':
# continue
# model.get(img, face)
ret.append(face)
return ret
俯仰角,偏航角,旋转角
poses = [face.pose.tolist() for face in faces]
