feat: 接口1/6 发际线贴近头顶时改为修正而非弃用置null
顶庭(头顶→发际线)<0.7cm 时不再返回 null: - 上庭 = 0.95×中庭 反推发际线;若越过头顶则顶庭固定 0.7cm(发际线钉在头顶下方) - hairline_source 新增 "corrected";to_response 始终输出完整四庭 - 标注图始终正常画发际线横线与庭段 - 接口6 三庭逻辑同步,去 discarded 分支 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -173,7 +173,7 @@ def test_hairline_gen_female(client, monkeypatch):
|
||||
assert set([f"eye{i}" for i in range(1, 8)]).issubset(fm["seven_eyes"].keys())
|
||||
assert set(["hair_top", "hairline", "brow_center",
|
||||
"nose_bottom", "chin_tip"]).issubset(fm["landmarks"].keys())
|
||||
assert fm["hairline_source"] in ("segmentation", "estimated")
|
||||
assert fm["hairline_source"] in ("segmentation", "estimated", "corrected")
|
||||
assert set(["yaw", "pitch", "roll"]).issubset(fm["head_pose"].keys())
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ def test_success_structure(client):
|
||||
assert data["seven_eyes"]["eye3"] is not None
|
||||
assert data["seven_eyes"]["eye4"] is not None
|
||||
assert data["seven_eyes"]["eye5"] is not None
|
||||
assert data["hairline_source"] in ("segmentation", "estimated")
|
||||
assert data["hairline_source"] in ("segmentation", "estimated", "corrected")
|
||||
# base64 解码为合法 PNG(非 URL)
|
||||
assert "annotated_image_url" not in data
|
||||
png = base64.b64decode(data["annotated_image_base64"])
|
||||
|
||||
Reference in New Issue
Block a user