Убраны этнос и эмоция из результатов анализа
This commit is contained in:
1 parent
e269598077
commit
572ed6bd5e
1 file changed
+1
-32
+1
-32
@@ -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")]
|
||||
|
||||
Reference in new issue
Block a user