File size: 1,637 Bytes
2b34e02
 
 
 
 
 
 
eae1cca
2b34e02
eae1cca
2b34e02
 
 
 
 
 
 
 
 
 
 
eae1cca
 
 
2b34e02
 
 
eae1cca
2b34e02
eae1cca
2b34e02
eae1cca
2b34e02
eae1cca
2b34e02
 
 
eae1cca
2b34e02
 
 
 
eae1cca
 
 
48798aa
2b34e02
 
 
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
import os
import sys


def input_pose(pose_select="front"):
    step = 1
    if pose_select == "front":
        pose = [[0.0, 0.0, 0.0] for i in range(0, 10, step)]  # -20 to 20
    elif pose_select == "left_right_shaking":
        pose = [[-i, 0.0, 0.0] for i in range(0, 20, step)]  # 0 to -20
        pose += [[i - 20.0, 0.0, 0.0] for i in range(0, 40, step)]  # -20 to 20
        pose += [[20.0 - i, 0.0, 0.0] for i in range(0, 20, step)]  # 20 to 0
        pose = pose + pose
        pose = pose + pose
        pose = pose + pose
    else:
        raise ValueError("pose_select Error")

    return pose


EMOTIONS = ["angry", "disgust", "fear", "happy", "sad", "surprise", "neutral"]


def input_emotion(emotion_select="neutral"):
    sacle_factor = 2
    if emotion_select == "neutral":
        emotion = [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0] for _ in range(2)]  # ((i%50))*0.04
    elif emotion_select == "happy":
        emotion = [[0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0] for _ in range(2)]  # ((i%50))*0.04
    elif emotion_select == "angry":
        emotion = [[1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] for _ in range(2)]
    elif emotion_select == "surprised":
        emotion = [[0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0] for _ in range(2)]
    else:
        raise ValueError("emotion_select Error")

    return emotion * sacle_factor


def input_blink(blink_select="yes"):
    if blink_select == "yes":
        blink = [[1.0] for _ in range(25)]
        blink += [[0.8], [0.6], [0.0], [0.0]]
        blink += [[1.0] for _ in range(5)]
        blink = blink + blink + blink
    else:
        blink = [[1.0] for _ in range(2)]
    return blink