AVCER / app /config.py
ElenaRyumina's picture
Summary
47aeb66
"""
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_VIDEO = {
0: "Neutral",
1: "Happiness",
2: "Sadness",
3: "Surprise",
4: "Fear",
5: "Disgust",
6: "Anger",
}
NAME_EMO_AUDIO = [
"Neutral",
"Anger",
"Disgust",
"Fear",
"Happiness",
"Sadness",
"Surprise",
"Other",
]
DICT_CE = {
"Fearfully Surprised": [3, 6],
"Happily Surprised": [4, 6],
"Sadly Surprised": [5, 6],
"Disgustedly Surprised": [2, 6],
"Angrily Surprised": [1, 6],
"Sadly Fearful": [3, 5],
"Sadly Angry": [1, 5],
"Sadly Disgusted": [2, 5],
"Fearfully Angry": [1, 3],
"Fearfully Disgusted": [2, 3],
"Angrily Disgusted": [1, 2],
"Happily Disgusted": [2, 4],
}
DICT_PRED = {
0: 'Neutral',
1: 'Anger',
2: 'Disgust',
3: 'Fear',
4: 'Happiness',
5: 'Sadness',
6: 'Surprise',
7: 'Fearfully Surprised',
8: 'Happily Surprised',
9: 'Sadly Surprised',
10: 'Disgustedly Surprised',
11: 'Angrily Surprised',
12: 'Sadly Fearful',
13: 'Sadly Angry',
14: 'Sadly Disgusted',
15: 'Fearfully Angry',
16: 'Fearfully Disgusted',
17: 'Angrily Disgusted',
18: 'Happily Disgusted',
}
AV_WEIGHTS = [
[
0.89900098,
0.10362151,
0.08577635,
0.04428126,
0.89679865,
0.02656456,
0.63040305,
],
[
0.01223291,
0.21364307,
0.66688002,
0.93791526,
0.0398964,
0.48670648,
0.22089692,
],
[
0.08876611,
0.68273542,
0.24734363,
0.01780348,
0.06330495,
0.48672896,
0.14870002,
],
]
COLORS = {
0: 'blue',
1: 'orange',
2: 'green',
3: 'red',
4: 'purple',
5: 'brown',
6: 'pink'
}