From 572ed6bd5e008459a7514400c8eb3e37ea54f141 Mon Sep 17 00:00:00 2001 From: Kavalar Date: Fri, 18 Sep 2026 11:42:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20=D1=8D?= =?UTF-8?q?=D1=82=D0=BD=D0=BE=D1=81=20=D0=B8=20=D1=8D=D0=BC=D0=BE=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B8=D0=B7=20=D1=80=D0=B5=D0=B7=D1=83=D0=BB?= =?UTF-8?q?=D1=8C=D1=82=D0=B0=D1=82=D0=BE=D0=B2=20=D0=B0=D0=BD=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interpret.py | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/interpret.py b/interpret.py index 4e27d66..9d10c2c 100644 --- a/interpret.py +++ b/interpret.py @@ -30,25 +30,6 @@ def interpret_result(data: dict) -> dict: # ── Демография ───────────────────────────────────────────── gender = "мужчина" if data.get("is_male") else "женщина" age = data.get("age", 0) - ethnicity_map = { - "white": "европеоид", - "black": "негроид", - "asian": "монголоид", - "unknown": "не определён", - } - ethnicity = ethnicity_map.get(data.get("ethnicity", ""), data.get("ethnicity", "не определён")) - - emotion_map = { - "happiness": "радость", - "sadness": "грусть", - "neutral": "спокойствие", - "anger": "злость", - "surprise": "удивление", - "fear": "страх", - "disgust": "отвращение", - "contempt": "презрение", - } - emotion = emotion_map.get(data.get("emotion", ""), data.get("emotion", "не определена")) metrics.append({ "name": "Пол", @@ -62,18 +43,6 @@ def interpret_result(data: dict) -> dict: "status": "info", "comment": "Оценка по лицу", }) - metrics.append({ - "name": "Этнос", - "value": ethnicity.capitalize(), - "status": "info", - "comment": "", - }) - metrics.append({ - "name": "Эмоция", - "value": emotion.capitalize(), - "status": "info", - "comment": "Эмоция в момент съёмки", - }) # ── ИМТ ──────────────────────────────────────────────────── bmi = data.get("bmi", 0) @@ -341,7 +310,7 @@ def interpret_result(data: dict) -> dict: }) # ── Сводка ───────────────────────────────────────────────── - summary = f"{gender.capitalize()}, {age} лет, {ethnicity}. Эмоция: {emotion}." + summary = f"{gender.capitalize()}, {age} лет." # Считаем проблемы problems = [m for m in metrics if m["status"] in ("warning", "danger")]