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")]