multimodalart HF Staff commited on
Commit
5ae8702
·
verified ·
1 Parent(s): e65e884

Drive SOMA fingers from the MCP/PIP/DIP joints, not the metacarpals

Browse files
Files changed (1) hide show
  1. soma_body.py +18 -10
soma_body.py CHANGED
@@ -34,6 +34,14 @@ import torch.nn as nn
34
 
35
  # SMPL-X joint index -> SOMA joint index.
36
  # SMPL-X hand order is index / middle / pinky / ring / thumb.
 
 
 
 
 
 
 
 
37
  SMPLX_TO_SOMA = [
38
  1, # 0 pelvis -> Hips
39
  68, # 1 left_hip -> LeftLeg
@@ -60,16 +68,16 @@ SMPLX_TO_SOMA = [
60
  9, # 22 jaw -> Jaw
61
  10, # 23 left_eye -> LeftEye
62
  11, # 24 right_eye -> RightEye
63
- 20, 21, 22, # left index
64
- 25, 26, 27, # left middle
65
- 35, 36, 37, # left pinky
66
- 30, 31, 32, # left ring
67
- 16, 17, 18, # left thumb
68
- 48, 49, 50, # right index
69
- 53, 54, 55, # right middle
70
- 63, 64, 65, # right pinky
71
- 58, 59, 60, # right ring
72
- 44, 45, 46, # right thumb
73
  ]
74
  assert len(SMPLX_TO_SOMA) == 55 and len(set(SMPLX_TO_SOMA)) == 55
75
 
 
34
 
35
  # SMPL-X joint index -> SOMA joint index.
36
  # SMPL-X hand order is index / middle / pinky / ring / thumb.
37
+ #
38
+ # Fingers need care: SOMA's four fingers carry one joint more than SMPL-X's.
39
+ # `<Finger>1` sits ~3 cm from the wrist at the base of the metacarpal (the four
40
+ # `*1` joints span only 4 cm across the palm), while `<Finger>2` sits ~9 cm out
41
+ # on the knuckle line (6.2 cm span) — i.e. SOMA `2/3/4` are the MCP / PIP / DIP
42
+ # joints that SMPL-X calls `1/2/3`. The metacarpals are left un-rotated, which
43
+ # is what SMPL-X assumes anyway. The thumb chain has no extra joint, so
44
+ # `Thumb1/2/3` map straight across.
45
  SMPLX_TO_SOMA = [
46
  1, # 0 pelvis -> Hips
47
  68, # 1 left_hip -> LeftLeg
 
68
  9, # 22 jaw -> Jaw
69
  10, # 23 left_eye -> LeftEye
70
  11, # 24 right_eye -> RightEye
71
+ 21, 22, 23, # left index -> LeftHandIndex2/3/4
72
+ 26, 27, 28, # left middle -> LeftHandMiddle2/3/4
73
+ 36, 37, 38, # left pinky -> LeftHandPinky2/3/4
74
+ 31, 32, 33, # left ring -> LeftHandRing2/3/4
75
+ 16, 17, 18, # left thumb -> LeftHandThumb1/2/3
76
+ 49, 50, 51, # right index -> RightHandIndex2/3/4
77
+ 54, 55, 56, # right middle -> RightHandMiddle2/3/4
78
+ 64, 65, 66, # right pinky -> RightHandPinky2/3/4
79
+ 59, 60, 61, # right ring -> RightHandRing2/3/4
80
+ 44, 45, 46, # right thumb -> RightHandThumb1/2/3
81
  ]
82
  assert len(SMPLX_TO_SOMA) == 55 and len(set(SMPLX_TO_SOMA)) == 55
83