File size: 838 Bytes
d1b31ce c0f6432 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
"""
File: config.py
Author: Elena Ryumina and Dmitry Ryumin
Description: Configuration file.
License: MIT License
"""
import toml
from typing import Dict
from types import SimpleNamespace
def flatten_dict(prefix: str, d: Dict) -> Dict:
result = {}
for k, v in d.items():
if isinstance(v, dict):
result.update(flatten_dict(f"{prefix}{k}_", v))
else:
result[f"{prefix}{k}"] = v
return result
config = toml.load("config.toml")
config_data = flatten_dict("", config)
config_data = SimpleNamespace(**config_data)
DICT_EMO = {
0: "Neutral",
1: "Happiness",
2: "Sadness",
3: "Surprise",
4: "Fear",
5: "Disgust",
6: "Anger",
}
COLORS = {
0: 'blue',
1: 'orange',
2: 'green',
3: 'red',
4: 'purple',
5: 'brown',
6: 'pink'
}
|