119 lines
2.8 KiB
Python
119 lines
2.8 KiB
Python
from dataclasses import dataclass, asdict
|
|
|
|
|
|
@dataclass
|
|
class HeadJoints:
|
|
# Eyebrow
|
|
left_eyebrow_outside_y: float = 0.0
|
|
left_eyebrow_inside_y: float = 0.0
|
|
right_eyebrow_outside_y: float = 0.0
|
|
right_eyebrow_inside_y: float = 0.0
|
|
|
|
# Eyelid
|
|
left_eye_upper_lid_y: float = 0.0
|
|
left_eye_lower_lid_y: float = 0.0
|
|
right_eye_upper_lid_y: float = 0.0
|
|
right_eye_lower_lid_y: float = 0.0
|
|
|
|
# Eyeball
|
|
left_eye_ball_x: float = 0.0
|
|
left_eye_ball_y: float = 0.0
|
|
right_eye_ball_x: float = 0.0
|
|
right_eye_ball_y: float = 0.0
|
|
|
|
# Nose
|
|
left_nose_y: float = 0.0
|
|
right_nose_y: float = 0.0
|
|
|
|
# Mouth
|
|
upper_lip_y: float = 0.0
|
|
upper_lip_z: float = 0.0
|
|
lower_lip_y: float = 0.0
|
|
lower_lip_z: float = 0.0
|
|
|
|
upper_left_lip_x: float = 0.0
|
|
upper_left_lip_y: float = 0.0
|
|
left_corner_lip_x: float = 0.0
|
|
left_corner_lip_y: float = 0.0
|
|
lower_left_lip_x: float = 0.0
|
|
lower_left_lip_y: float = 0.0
|
|
left_corner_lip_z: float = 0.0
|
|
|
|
upper_right_lip_x: float = 0.0
|
|
upper_right_lip_y: float = 0.0
|
|
right_corner_lip_x: float = 0.0
|
|
right_corner_lip_y: float = 0.0
|
|
lower_right_lip_x: float = 0.0
|
|
lower_right_lip_y: float = 0.0
|
|
right_corner_lip_z: float = 0.0
|
|
|
|
# Jaw
|
|
jaw_x: float = 0.0
|
|
jaw_y: float = 0.0
|
|
|
|
def __str__(self):
|
|
return str(asdict(self))
|
|
|
|
def to_dict(self):
|
|
return asdict(self)
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class FaceMap:
|
|
# Base head anchors
|
|
left_head: int = 234
|
|
right_head: int = 454
|
|
top_head: int = 10
|
|
bottom_head: int = 152
|
|
front_head: int = 1
|
|
|
|
# Left eyebrow
|
|
left_eyebrow_outside: int = 300
|
|
left_eyebrow_inside: int = 285
|
|
|
|
# Right eyebrow
|
|
right_eyebrow_outside: int = 70
|
|
right_eyebrow_inside: int = 55
|
|
|
|
# Left eyelid
|
|
left_eyelid_outside: int = 263
|
|
left_eyelid_inside: int = 362
|
|
left_eyelid_upper: int = 386
|
|
left_eyelid_lower: int = 374
|
|
|
|
# Right eyelid
|
|
right_eyelid_outside: int = 33
|
|
right_eyelid_inside: int = 133
|
|
right_eyelid_upper: int = 159
|
|
right_eyelid_lower: int = 145
|
|
|
|
# Left eyeball
|
|
left_eyeball_center: int = 473
|
|
left_eyeball_outside: int = 476
|
|
left_eyeball_inside: int = 474
|
|
left_eyeball_up: int = 475
|
|
left_eyeball_down: int = 477
|
|
|
|
# Right eyeball
|
|
right_eyeball_center: int = 468
|
|
right_eyeball_outside: int = 471
|
|
right_eyeball_inside: int = 469
|
|
right_eyeball_up: int = 470
|
|
right_eyeball_down: int = 472
|
|
|
|
# Mouth
|
|
mid_up_lip: int = 0
|
|
mid_down_lip: int = 17
|
|
right_upper_lip: int = 39
|
|
right_mouth_corner: int = 61
|
|
right_lower_lip: int = 181
|
|
left_upper_lip: int = 269
|
|
left_mouth_corner: int = 291
|
|
left_lower_lip: int = 405
|
|
|
|
def __str__(self):
|
|
return str(asdict(self))
|
|
|
|
def to_dict(self):
|
|
return asdict(self)
|