-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetting.py
159 lines (143 loc) · 4.79 KB
/
setting.py
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
from enum import Enum
import numpy as np
class TypeData(Enum):
BODY = 0
HAND = 1
class HandJointType(Enum):
BAMB_0 = 0
BAMB_1 = 1
BIG_TOE = 2
BIG_TOE_1 = 3
BIG_TOE_2 = 4
FINGER_1 = 5
FINGER_1_1 = 6
FINGER_1_2 = 7
FINGER_1_3 = 8
FINGER_2 = 9
FINGER_2_1 = 10
FINGER_2_2 = 11
FINGER_2_3 = 12
FINGER_3 = 13
FINGER_3_1 = 14
FINGER_3_2 = 15
FINGER_3_3 = 16
FINGER_4 = 17
FINGER_4_1 = 18
FINGER_4_2 = 19
FINGER_4_3 = 20
class JointType(Enum):
Nose = 0
Neck = 1
RightShoulder = 2
RightElbow = 3
RightHand = 4
LeftShoulder = 5
LeftElbow = 6
LeftHand = 7
RightWaist = 8
RightKnee = 9
RightFoot = 10
LeftWaist = 11
LeftKnee = 12
LeftFoot = 13
RightEye = 14
LeftEye = 15
RightEar = 16
LeftEar = 17
hand_join_indices = [
HandJointType.BAMB_0,
HandJointType.BAMB_1,
HandJointType.BIG_TOE,
HandJointType.BIG_TOE_1,
HandJointType.BIG_TOE_2,
HandJointType.FINGER_1,
HandJointType.FINGER_1_1,
HandJointType.FINGER_1_2,
HandJointType.FINGER_1_3,
HandJointType.FINGER_2,
HandJointType.FINGER_2_1,
HandJointType.FINGER_2_2,
HandJointType.FINGER_2_3,
HandJointType.FINGER_3,
HandJointType.FINGER_3_1,
HandJointType.FINGER_3_2,
HandJointType.FINGER_3_3,
HandJointType.FINGER_4,
HandJointType.FINGER_4_1,
HandJointType.FINGER_4_2,
HandJointType.FINGER_4_3
]
coco_joint_indices= [
JointType.Nose,
JointType.LeftEye,
JointType.RightEye,
JointType.LeftEar,
JointType.RightEar,
JointType.LeftShoulder,
JointType.RightShoulder,
JointType.LeftElbow,
JointType.RightElbow,
JointType.LeftHand,
JointType.RightHand,
JointType.LeftWaist,
JointType.RightWaist,
JointType.LeftKnee,
JointType.RightKnee,
JointType.LeftFoot,
JointType.RightFoot
]
LIMBS = [[JointType.Neck, JointType.RightWaist],
[JointType.RightWaist, JointType.RightKnee],
[JointType.RightKnee, JointType.RightFoot],
[JointType.Neck, JointType.LeftWaist],
[JointType.LeftWaist, JointType.LeftKnee],
[JointType.LeftKnee, JointType.LeftFoot],
[JointType.Neck, JointType.RightShoulder],
[JointType.RightShoulder, JointType.RightElbow],
[JointType.RightElbow, JointType.RightHand],
[JointType.RightShoulder, JointType.RightEar],
[JointType.Neck, JointType.LeftShoulder],
[JointType.LeftShoulder, JointType.LeftElbow],
[JointType.LeftElbow, JointType.LeftHand],
[JointType.LeftShoulder, JointType.LeftEar],
[JointType.Neck, JointType.Nose],
[JointType.Nose, JointType.RightEye],
[JointType.Nose, JointType.LeftEye],
[JointType.RightEye, JointType.RightEar],
[JointType.LeftEye, JointType.LeftEar]]
HANDLINES = [
[HandJointType.BAMB_0, HandJointType.BAMB_1],
[HandJointType.BAMB_1, HandJointType.BIG_TOE],
[HandJointType.BIG_TOE, HandJointType.BIG_TOE_1],
[HandJointType.BIG_TOE_1, HandJointType.BIG_TOE_2],
[HandJointType.BAMB_0, HandJointType.FINGER_1],
[HandJointType.FINGER_1, HandJointType.FINGER_1_1],
[HandJointType.FINGER_1_1, HandJointType.FINGER_1_2],
[HandJointType.FINGER_1_2, HandJointType.FINGER_1_3],
[HandJointType.BAMB_0, HandJointType.FINGER_2],
[HandJointType.FINGER_2, HandJointType.FINGER_2_1],
[HandJointType.FINGER_2_1, HandJointType.FINGER_2_2],
[HandJointType.FINGER_2_2, HandJointType.FINGER_2_3],
[HandJointType.BAMB_0, HandJointType.FINGER_3],
[HandJointType.FINGER_3, HandJointType.FINGER_3_1],
[HandJointType.FINGER_3_1, HandJointType.FINGER_3_2],
[HandJointType.FINGER_3_2, HandJointType.FINGER_3_3],
[HandJointType.BAMB_0, HandJointType.FINGER_4],
[HandJointType.FINGER_4, HandJointType.FINGER_4_1],
[HandJointType.FINGER_4_1, HandJointType.FINGER_4_2],
[HandJointType.FINGER_4_2, HandJointType.FINGER_4_3],
]
body_edges = np.array(
[[0, 1], # neck - nose
[1, 16], [16, 18], # nose - l_eye - l_ear
[1, 15], [15, 17], # nose - r_eye - r_ear
[0, 3], [3, 4], [4, 5], # neck - l_shoulder - l_elbow - l_wrist
[0, 9], [9, 10], [10, 11], # neck - r_shoulder - r_elbow - r_wrist
[0, 6], [6, 7], [7, 8], # neck - l_hip - l_knee - l_ankle
[0, 12], [12, 13], [13, 14]]) # neck - r_hip - r_knee - r_ankle
hand_edges = [[0, 1],
[1, 2], [2, 3], [3, 4], # nose - l_eye - l_ear
[0, 5], [5, 6],[6, 7],[7, 8], # nose - r_eye - r_ear
[0, 9], [9,10], [10, 11],[11, 12], # neck - l_shoulder - l_elbow - l_wrist
[0, 13], [13, 14], [14, 15],[15, 16], # neck - r_shoulder - r_elbow - r_wrist
[0, 17], [17, 18], [18, 19],[19, 20]] # neck - r_hip - r_knee - r_ankle