Spaces:
Running
on
Zero
Running
on
Zero
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 | |