CoolFace
Apppublic

Masterdqqq/Facial_Expression_Recognition

sourceHugging Facemitupdated 2y agoView on Hugging Face
1likes
config.py50 linesDownload Raw Back to app
1"""2File: config.py3Author: Elena Ryumina and Dmitry Ryumin4Description: Configuration file.5License: MIT License6"""7 8import toml9from typing import Dict10from types import SimpleNamespace11 12 13def flatten_dict(prefix: str, d: Dict) -> Dict:14    result = {}15 16    for k, v in d.items():17        if isinstance(v, dict):18            result.update(flatten_dict(f"{prefix}{k}_", v))19        else:20            result[f"{prefix}{k}"] = v21 22    return result23 24 25config = toml.load("config.toml")26 27config_data = flatten_dict("", config)28 29config_data = SimpleNamespace(**config_data)30 31DICT_EMO = {32    0: "Neutral",33    1: "Happiness",34    2: "Sadness",35    3: "Surprise",36    4: "Fear",37    5: "Disgust",38    6: "Anger",39}40 41COLORS = {42    0: 'blue', 43    1: 'orange', 44    2: 'green', 45    3: 'red', 46    4: 'purple', 47    5: 'brown', 48    6: 'pink'49}50