feat(接口4): 精简输出为固定6个英文字段,缩短提示词
- face_features.py:_PROMPT 只问6项特征(+有无人脸),analyze_features 只返回6个英文字段;无人脸返回 None(不再依赖 has_face 在外部判定) - gateway/app.py:无脸判定改为 feats is None,去掉 has_face import - app.py / docs / test_interface4.html:Swagger/文档/示例/测试页同步 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -291,7 +291,7 @@ async def face_features(
|
||||
})
|
||||
|
||||
from fastapi.concurrency import run_in_threadpool
|
||||
from face_features import analyze_features, has_face
|
||||
from face_features import analyze_features
|
||||
|
||||
try:
|
||||
feats = await run_in_threadpool(analyze_features, img_bytes, image_url)
|
||||
@@ -302,7 +302,7 @@ async def face_features(
|
||||
"request_id": f"gw-{_uuid.uuid4().hex[:8]}", "data": None,
|
||||
})
|
||||
|
||||
if not has_face(feats):
|
||||
if feats is None:
|
||||
return JSONResponse(status_code=200, content={
|
||||
"code": 1001, "message": "无法识别人像",
|
||||
"request_id": f"gw-{_uuid.uuid4().hex[:8]}", "data": None,
|
||||
|
||||
Reference in New Issue
Block a user