File size: 2,695 Bytes
47aeb66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
"""
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'
}