fix(worker): 保持旧关键点契约并验证内部鉴权
This commit is contained in:
@@ -65,10 +65,15 @@ def detect_framed_ratio_points(image):
|
||||
def _detect_ratio_points(image, landmarks):
|
||||
from hairline.face_landmarks import to_landmark_list
|
||||
|
||||
from .calibration import normalized_to_pixel
|
||||
from .special_points import detect_special_points
|
||||
|
||||
data = detect_special_points(image, landmarks_override=to_landmark_list(landmarks))
|
||||
override = to_landmark_list(landmarks)
|
||||
data = detect_special_points(image, landmarks_override=override)
|
||||
points = data["points"]
|
||||
height, width = image.shape[:2]
|
||||
x, y = normalized_to_pixel(override.landmark[454], width, height)
|
||||
points["face_edge_454"] = {"x": round(x), "y": round(y)}
|
||||
data["ft_original_points"] = {key: points[key] for key in FT_POINTS}
|
||||
a, b = (points[key] for key in FT_POINTS)
|
||||
if a is not None and b is not None:
|
||||
|
||||
@@ -30,7 +30,7 @@ GROUPS = {
|
||||
"mouth": [0, 37, 40, 67, 91, 84, 17, 405, 375, 409, 269],
|
||||
"nose_midline": [9, 168, 197, 5, 4, 194, 278, 48, 437, 217],
|
||||
"cheek": [101, 117, 123, 187, 205, 50, 330, 346, 352, 280, 425],
|
||||
"face_edge": [162, 234, 58, 136, 149, 152, 378, 365, 288, 401, 366, 389, 251, 454],
|
||||
"face_edge": [162, 234, 58, 136, 149, 152, 378, 365, 288, 401, 366, 389, 251],
|
||||
}
|
||||
|
||||
# 发际线点定义:字段名 → 参与计算的 (起点ID, 方向点ID) 射线组;单射线直接取交点,
|
||||
|
||||
Reference in New Issue
Block a user