diff --git a/image/image_analyzer.py b/image/image_analyzer.py index fa5a71e..62d50aa 100755 --- a/image/image_analyzer.py +++ b/image/image_analyzer.py @@ -244,6 +244,10 @@ class ImageAnalyzer: "表格", "检索表", "配伍表", "药物配伍", "课程表", "流程表", "说明表", "数据表", "word wall", "poster wall", "bulletin board", ) + MANY_FACES_SUBJECT_KEYWORDS = ( + "多人", "多人脸", "人群", "群像", "合照", "集体照", "全家福", "毕业照", "婚礼合影", "大合照", + "crowd", "group photo", "many faces", + ) async def analyze(self, image_path: str) -> dict: """ @@ -624,14 +628,24 @@ class ImageAnalyzer: price_suggest = 80 reason += " | 大量文字分层" - # 硬规则:密集文字类图片不接单(知识宣传栏/公告栏等) - if text_amount in ["大量 (51-200 字)", "极多 (200 字以上)"] or dense_text_scene: + # 硬规则1:文字很多(>100)且密密麻麻不接单 + text_gt_100 = text_amount in ["大量 (51-200 字)", "极多 (200 字以上)"] + if text_gt_100 or dense_text_scene: feasibility = "no" risk = "high" note = "文字内容过于密集(如宣传栏/公告栏),暂不接单处理" reason = (reason or "文字密集") + " | 密集文字场景不接单" price_suggest = 0 + # 硬规则2:多人脸不接;1-2 人脸可做 + many_faces_scene = any(k in (subject_raw + " " + reason_raw + " " + note_raw).lower() for k in self.MANY_FACES_SUBJECT_KEYWORDS) + if has_face == "yes" and many_faces_scene: + feasibility = "no" + risk = "high" + note = "多人脸/群像场景处理风险高,暂不接单" + reason = (reason or "多人脸") + " | 多人脸场景不接单" + price_suggest = 0 + # 确保是 5 的倍数 price_suggest = round(price_suggest / 5) * 5