diff --git a/apps/worker/worker_app/tasks/viral_video.py b/apps/worker/worker_app/tasks/viral_video.py index 35c68530f..f261717ba 100644 --- a/apps/worker/worker_app/tasks/viral_video.py +++ b/apps/worker/worker_app/tasks/viral_video.py @@ -331,20 +331,29 @@ def _vision_fallback(idx: int, reason: str, extra: dict | None = None) -> dict: def _is_vision_result_usable(result: dict) -> bool: - """判断 VLM 返回是否有效:name/summary 不能为未识别/无法判断/空,summary 要够长。""" + """判断 VLM 返回是否有效。 + #2198b: 判定条件放宽——有人像(portrait_prompt非空/非'无人像')即视为usable(爆款视频核心 + 是要人物描述给信任链t2i用,product name/brand/features识别不准是次要的)。 + 非人像场景才要求name+summary+features有效。 + """ if not isinstance(result, dict): return False + # 有人像描述(爆款视频最核心需求,portrait_prompt给信任链t2i做参考)就视为usable + pp = (result.get("portrait_prompt") or "").strip() + if pp and pp not in ("无人像", "无法判断", "未识别"): + return True + # 非人像场景:要求name+summary有效 name = (result.get("name") or "").strip() if not name or name in ("未识别", "无法判断", "未知"): return False summary = (result.get("summary") or "").strip() - if len(summary) < 30 or summary in ("无法判断", "未识别"): + if len(summary) < 5 or summary in ("无法判断", "未识别"): return False category = (result.get("category") or "").strip() if category == "非产品图": return True feats = result.get("key_features") or [] - if not isinstance(feats, list) or len(feats) == 0: + if not isinstance(feats, list) or len(feats) == 0 or feats == ["无法判断"]: return False return True