feat: 新增42号人脸特征与72号B端关键点接口

This commit is contained in:
xsl
2026-11-07 20:35:55 +08:00
parent ccb9c142c4
commit c9a47a76c9
16 changed files with 983 additions and 25 deletions
+19
View File
@@ -66,6 +66,25 @@ class FaceLandmarker:
pass
def to_landmark_list(landmarks):
from mediapipe.framework.formats import landmark_pb2
result = landmark_pb2.NormalizedLandmarkList()
for x, y, z in landmarks:
result.landmark.add(x=float(x), y=float(y), z=float(z))
return result
_landmarker = None
def get_landmarker() -> FaceLandmarker:
global _landmarker
if _landmarker is None:
_landmarker = FaceLandmarker(static_image_mode=True)
return _landmarker
class SolutionsFaceLandmarker:
"""CPU-oriented fallback using mediapipe.solutions.face_mesh."""