style: auto-format with black + isort + ruff + prettier [skip ci-format-check]
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 1s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1s
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 47s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m16s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 2m22s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 2m44s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m0s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 3m13s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 6m7s
AI Code Review / AI Code Review (pull_request) Successful in 6m31s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 7m29s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 7m34s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 1s
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 7m34s

This commit is contained in:
CI Bot
2026-10-04 17:34:11 +00:00
parent 27f29cc31e
commit bd1050a23f
+60 -12
View File
@@ -458,22 +458,60 @@ def _analyze_single_image(
_pf = (_ppn.get("attrs") or {}).get("features", "") or ""
_ptxt = _pn + " " + _pf
# 服装关键词识别(常见上装/下装/裙装/套装)
_cloth_kws = ["衬衫","T恤","毛衣","针织衫","卫衣","外套","西装","夹克","风衣",
"大衣","羽绒服","马甲","背心","连衣裙","半身裙","短裙","长裙",
"牛仔裤","休闲裤","西裤","运动裤","短裤","旗袍","汉服","制服",
"polo衫","POLO衫","针织","毛衫","开衫","帽衫","皮夹克","皮衣"]
_cloth_kws = [
"衬衫",
"T恤",
"毛衣",
"针织衫",
"卫衣",
"外套",
"西装",
"夹克",
"风衣",
"大衣",
"羽绒服",
"马甲",
"背心",
"连衣裙",
"半身裙",
"短裙",
"长裙",
"牛仔裤",
"休闲裤",
"西裤",
"运动裤",
"短裤",
"旗袍",
"汉服",
"制服",
"polo衫",
"POLO衫",
"针织",
"毛衫",
"开衫",
"帽衫",
"皮夹克",
"皮衣",
]
for _ckw in _cloth_kws:
if _ckw in _ptxt:
_ci = _ptxt.find(_ckw)
# 向前找颜色/材质/款式形容词(白/黑/米/红/蓝/灰/棉/麻/长/短/厚/薄/长袖/短袖/翻领/圆领/V领/印花/条纹等)
_start = max(0, _ci-8)
_start = max(0, _ci - 8)
# 向后包含款式词(长袖/短袖/外套/套装/上衣等后续修饰)
_end = min(len(_ptxt), _ci+len(_ckw)+4)
_end = min(len(_ptxt), _ci + len(_ckw) + 4)
_outfit_extract = _ptxt[_start:_end].strip(" ,,。.、")
# 仅清理明确的品牌/产品类前缀(不清理颜色/款式/尺寸形容词)
_outfit_extract = re.sub(r"^(\S{0,4}牌|\S{0,3}品牌|\S{0,3}款|产品|商品|的)", "", _outfit_extract).strip()
_outfit_extract = re.sub(
r"^(\S{0,4}牌|\S{0,3}品牌|\S{0,3}款|产品|商品|的)", "", _outfit_extract
).strip()
# 尾部清理:去掉残留的品牌字/型号字(如"标""ml""g""装"等单字杂字)
_outfit_extract = re.sub(r"(标[0-9a-zA-Z]*|\d+\s*(?:ml|g|L|斤|件|个|瓶|盒|包|袋|装)|\s+\d+\s*)$", "", _outfit_extract, flags=re.IGNORECASE).strip()
_outfit_extract = re.sub(
r"(标[0-9a-zA-Z]*|\d+\s*(?:ml|g|L|斤|件|个|瓶|盒|包|袋|装)|\s+\d+\s*)$",
"",
_outfit_extract,
flags=re.IGNORECASE,
).strip()
if len(_outfit_extract) >= 2:
_outfit = _outfit_extract
break
@@ -483,14 +521,24 @@ def _analyze_single_image(
if _hair in ("自然发型", "无法判断"):
_hair_color = ""
_color_nodes = [n for n in nodes if n["tag"] == "color"]
_hair_kws_map = {"黑":"黑色","棕":"棕色","金":"金色","栗":"栗色","红":"红色",
"白":"白色","灰":"灰色","蓝":"蓝色","黄":"黄色","紫":"紫色"}
_hair_kws_map = {
"黑": "黑色",
"棕": "棕色",
"金": "金色",
"栗": "栗色",
"红": "红色",
"白": "白色",
"灰": "灰色",
"蓝": "蓝色",
"黄": "黄色",
"紫": "紫色",
}
for _cn in _color_nodes:
_cname = (_cn.get("attrs") or {}).get("name","") or ""
_cname = (_cn.get("attrs") or {}).get("name", "") or ""
# 小占比颜色更可能是发色(非主色的小面积色),且名称含头发/黑/棕/金等
_ccov = 0.0
try:
_ccov = float((_cn.get("attrs") or {}).get("coverage","0") or 0)
_ccov = float((_cn.get("attrs") or {}).get("coverage", "0") or 0)
except Exception:
pass
for _hk, _hv in _hair_kws_map.items():