用途:MediaPipe Face Mesh 实时生成 468 个 3D 面部关键点,是各类主动活体检测挑战的基础,可用于检测眨眼、头部转动和面部表情。
主要能力:输出归一化的 468 个关键点(x、y、z);开启 refine_landmarks 后额外提供虹膜关键点,提升眨眼检测精度。资料给出各任务的关键索引:左眼 33、133、159、145、158、153;鼻 1、4;嘴 61、291、13、14。可将 3D 坐标按帧尺寸投影到 2D 以计算位置。
使用方式:安装 pip install mediapipe。初始化 mp_face_mesh = mp.solutions.face_mesh.FaceMesh(static_image_mode=False, max_num_faces=1, refine_landmarks=True, min_detection_confidence=0.5, min_tracking_confidence=0.5)。处理帧 results = mp_face_mesh.process(rgb_frame)。提取 landmarks = results.multi_face_landmarks[0].landmark。
适用场景:所有需要检测面部运动或特定表情的主动活体检测挑战。
限制与注意:建议在专用线程中运行,避免阻塞主流程。官方文档:https://google.github.io/mediapipe/solutions/face_mesh。其他平台支持、性能指标与收费信息暂未提供。