rtmlib-ts 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/.gitattributes +1 -0
  2. package/README.md +202 -0
  3. package/dist/core/base.d.ts +20 -0
  4. package/dist/core/base.d.ts.map +1 -0
  5. package/dist/core/base.js +40 -0
  6. package/dist/core/file.d.ts +11 -0
  7. package/dist/core/file.d.ts.map +1 -0
  8. package/dist/core/file.js +111 -0
  9. package/dist/core/modelCache.d.ts +35 -0
  10. package/dist/core/modelCache.d.ts.map +1 -0
  11. package/dist/core/modelCache.js +161 -0
  12. package/dist/core/posePostprocessing.d.ts +12 -0
  13. package/dist/core/posePostprocessing.d.ts.map +1 -0
  14. package/dist/core/posePostprocessing.js +76 -0
  15. package/dist/core/postprocessing.d.ts +10 -0
  16. package/dist/core/postprocessing.d.ts.map +1 -0
  17. package/dist/core/postprocessing.js +70 -0
  18. package/dist/core/preprocessing.d.ts +14 -0
  19. package/dist/core/preprocessing.d.ts.map +1 -0
  20. package/dist/core/preprocessing.js +79 -0
  21. package/dist/index.d.ts +27 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +31 -0
  24. package/dist/models/rtmpose.d.ts +25 -0
  25. package/dist/models/rtmpose.d.ts.map +1 -0
  26. package/dist/models/rtmpose.js +185 -0
  27. package/dist/models/rtmpose3d.d.ts +28 -0
  28. package/dist/models/rtmpose3d.d.ts.map +1 -0
  29. package/dist/models/rtmpose3d.js +184 -0
  30. package/dist/models/yolo12.d.ts +23 -0
  31. package/dist/models/yolo12.d.ts.map +1 -0
  32. package/dist/models/yolo12.js +165 -0
  33. package/dist/models/yolox.d.ts +18 -0
  34. package/dist/models/yolox.d.ts.map +1 -0
  35. package/dist/models/yolox.js +167 -0
  36. package/dist/solution/animalDetector.d.ts +229 -0
  37. package/dist/solution/animalDetector.d.ts.map +1 -0
  38. package/dist/solution/animalDetector.js +663 -0
  39. package/dist/solution/body.d.ts +16 -0
  40. package/dist/solution/body.d.ts.map +1 -0
  41. package/dist/solution/body.js +52 -0
  42. package/dist/solution/bodyWithFeet.d.ts +16 -0
  43. package/dist/solution/bodyWithFeet.d.ts.map +1 -0
  44. package/dist/solution/bodyWithFeet.js +52 -0
  45. package/dist/solution/customDetector.d.ts +137 -0
  46. package/dist/solution/customDetector.d.ts.map +1 -0
  47. package/dist/solution/customDetector.js +342 -0
  48. package/dist/solution/hand.d.ts +14 -0
  49. package/dist/solution/hand.d.ts.map +1 -0
  50. package/dist/solution/hand.js +20 -0
  51. package/dist/solution/index.d.ts +10 -0
  52. package/dist/solution/index.d.ts.map +1 -0
  53. package/dist/solution/index.js +9 -0
  54. package/dist/solution/objectDetector.d.ts +172 -0
  55. package/dist/solution/objectDetector.d.ts.map +1 -0
  56. package/dist/solution/objectDetector.js +606 -0
  57. package/dist/solution/pose3dDetector.d.ts +145 -0
  58. package/dist/solution/pose3dDetector.d.ts.map +1 -0
  59. package/dist/solution/pose3dDetector.js +611 -0
  60. package/dist/solution/poseDetector.d.ts +198 -0
  61. package/dist/solution/poseDetector.d.ts.map +1 -0
  62. package/dist/solution/poseDetector.js +622 -0
  63. package/dist/solution/poseTracker.d.ts +22 -0
  64. package/dist/solution/poseTracker.d.ts.map +1 -0
  65. package/dist/solution/poseTracker.js +106 -0
  66. package/dist/solution/wholebody.d.ts +19 -0
  67. package/dist/solution/wholebody.d.ts.map +1 -0
  68. package/dist/solution/wholebody.js +82 -0
  69. package/dist/solution/wholebody3d.d.ts +22 -0
  70. package/dist/solution/wholebody3d.d.ts.map +1 -0
  71. package/dist/solution/wholebody3d.js +75 -0
  72. package/dist/types/index.d.ts +52 -0
  73. package/dist/types/index.d.ts.map +1 -0
  74. package/dist/types/index.js +5 -0
  75. package/dist/visualization/draw.d.ts +57 -0
  76. package/dist/visualization/draw.d.ts.map +1 -0
  77. package/dist/visualization/draw.js +400 -0
  78. package/dist/visualization/skeleton/coco133.d.ts +350 -0
  79. package/dist/visualization/skeleton/coco133.d.ts.map +1 -0
  80. package/dist/visualization/skeleton/coco133.js +120 -0
  81. package/dist/visualization/skeleton/coco17.d.ts +180 -0
  82. package/dist/visualization/skeleton/coco17.d.ts.map +1 -0
  83. package/dist/visualization/skeleton/coco17.js +48 -0
  84. package/dist/visualization/skeleton/halpe26.d.ts +278 -0
  85. package/dist/visualization/skeleton/halpe26.d.ts.map +1 -0
  86. package/dist/visualization/skeleton/halpe26.js +70 -0
  87. package/dist/visualization/skeleton/hand21.d.ts +196 -0
  88. package/dist/visualization/skeleton/hand21.d.ts.map +1 -0
  89. package/dist/visualization/skeleton/hand21.js +51 -0
  90. package/dist/visualization/skeleton/index.d.ts +10 -0
  91. package/dist/visualization/skeleton/index.d.ts.map +1 -0
  92. package/dist/visualization/skeleton/index.js +9 -0
  93. package/dist/visualization/skeleton/openpose134.d.ts +357 -0
  94. package/dist/visualization/skeleton/openpose134.d.ts.map +1 -0
  95. package/dist/visualization/skeleton/openpose134.js +116 -0
  96. package/dist/visualization/skeleton/openpose18.d.ts +177 -0
  97. package/dist/visualization/skeleton/openpose18.d.ts.map +1 -0
  98. package/dist/visualization/skeleton/openpose18.js +47 -0
  99. package/docs/ANIMAL_DETECTOR.md +450 -0
  100. package/docs/CUSTOM_DETECTOR.md +568 -0
  101. package/docs/OBJECT_DETECTOR.md +373 -0
  102. package/docs/POSE3D_DETECTOR.md +458 -0
  103. package/docs/POSE_DETECTOR.md +442 -0
  104. package/examples/README.md +119 -0
  105. package/examples/index.html +746 -0
  106. package/package.json +51 -0
  107. package/playground/README.md +114 -0
  108. package/playground/app/favicon.ico +0 -0
  109. package/playground/app/globals.css +17 -0
  110. package/playground/app/layout.tsx +19 -0
  111. package/playground/app/page.tsx +1338 -0
  112. package/playground/eslint.config.mjs +18 -0
  113. package/playground/next.config.ts +34 -0
  114. package/playground/package-lock.json +6723 -0
  115. package/playground/package.json +27 -0
  116. package/playground/postcss.config.mjs +7 -0
  117. package/playground/tsconfig.json +34 -0
  118. package/src/core/base.ts +66 -0
  119. package/src/core/file.ts +141 -0
  120. package/src/core/modelCache.ts +189 -0
  121. package/src/core/posePostprocessing.ts +91 -0
  122. package/src/core/postprocessing.ts +93 -0
  123. package/src/core/preprocessing.ts +127 -0
  124. package/src/index.ts +69 -0
  125. package/src/models/rtmpose.ts +265 -0
  126. package/src/models/rtmpose3d.ts +289 -0
  127. package/src/models/yolo12.ts +220 -0
  128. package/src/models/yolox.ts +214 -0
  129. package/src/solution/animalDetector.ts +955 -0
  130. package/src/solution/body.ts +89 -0
  131. package/src/solution/bodyWithFeet.ts +89 -0
  132. package/src/solution/customDetector.ts +474 -0
  133. package/src/solution/hand.ts +52 -0
  134. package/src/solution/index.ts +10 -0
  135. package/src/solution/objectDetector.ts +816 -0
  136. package/src/solution/pose3dDetector.ts +890 -0
  137. package/src/solution/poseDetector.ts +892 -0
  138. package/src/solution/poseTracker.ts +172 -0
  139. package/src/solution/wholebody.ts +130 -0
  140. package/src/solution/wholebody3d.ts +125 -0
  141. package/src/types/index.ts +62 -0
  142. package/src/visualization/draw.ts +543 -0
  143. package/src/visualization/skeleton/coco133.ts +131 -0
  144. package/src/visualization/skeleton/coco17.ts +49 -0
  145. package/src/visualization/skeleton/halpe26.ts +71 -0
  146. package/src/visualization/skeleton/hand21.ts +52 -0
  147. package/src/visualization/skeleton/index.ts +10 -0
  148. package/src/visualization/skeleton/openpose134.ts +125 -0
  149. package/src/visualization/skeleton/openpose18.ts +48 -0
  150. package/tsconfig.json +32 -0
@@ -0,0 +1,49 @@
1
+ /**
2
+ * COCO17 skeleton configuration
3
+ * 17 keypoints for body pose estimation
4
+ */
5
+
6
+ export const coco17 = {
7
+ keypoint_info: {
8
+ 0: { name: 'nose', id: 0, color: [51, 255, 255] },
9
+ 1: { name: 'left_eye', id: 1, color: [51, 255, 255] },
10
+ 2: { name: 'right_eye', id: 2, color: [51, 255, 255] },
11
+ 3: { name: 'left_ear', id: 3, color: [51, 255, 255] },
12
+ 4: { name: 'right_ear', id: 4, color: [51, 255, 255] },
13
+ 5: { name: 'left_shoulder', id: 5, color: [255, 51, 255] },
14
+ 6: { name: 'right_shoulder', id: 6, color: [255, 51, 255] },
15
+ 7: { name: 'left_elbow', id: 7, color: [255, 51, 255] },
16
+ 8: { name: 'right_elbow', id: 8, color: [255, 51, 255] },
17
+ 9: { name: 'left_wrist', id: 9, color: [255, 51, 255] },
18
+ 10: { name: 'right_wrist', id: 10, color: [255, 51, 255] },
19
+ 11: { name: 'left_hip', id: 11, color: [255, 255, 51] },
20
+ 12: { name: 'right_hip', id: 12, color: [255, 255, 51] },
21
+ 13: { name: 'left_knee', id: 13, color: [255, 255, 51] },
22
+ 14: { name: 'right_knee', id: 14, color: [255, 255, 51] },
23
+ 15: { name: 'left_ankle', id: 15, color: [255, 255, 51] },
24
+ 16: { name: 'right_ankle', id: 16, color: [255, 255, 51] },
25
+ },
26
+ skeleton_info: {
27
+ 0: { link: ['left_ankle', 'left_knee'], color: [255, 51, 255] },
28
+ 1: { link: ['left_knee', 'left_hip'], color: [255, 51, 255] },
29
+ 2: { link: ['left_hip', 'right_hip'], color: [255, 255, 51] },
30
+ 3: { link: ['right_hip', 'right_knee'], color: [255, 51, 255] },
31
+ 4: { link: ['right_knee', 'right_ankle'], color: [255, 51, 255] },
32
+ 5: { link: ['left_hip', 'left_shoulder'], color: [255, 255, 51] },
33
+ 6: { link: ['left_shoulder', 'left_elbow'], color: [255, 255, 51] },
34
+ 7: { link: ['left_elbow', 'left_wrist'], color: [255, 255, 51] },
35
+ 8: { link: ['left_hip', 'right_shoulder'], color: [255, 255, 51] },
36
+ 9: { link: ['right_shoulder', 'right_elbow'], color: [255, 255, 51] },
37
+ 10: { link: ['right_elbow', 'right_wrist'], color: [255, 255, 51] },
38
+ 11: { link: ['left_shoulder', 'right_shoulder'], color: [255, 255, 51] },
39
+ 12: { link: ['nose', 'left_shoulder'], color: [255, 255, 51] },
40
+ 13: { link: ['nose', 'right_shoulder'], color: [255, 255, 51] },
41
+ 14: { link: ['nose', 'left_eye'], color: [255, 255, 51] },
42
+ 15: { link: ['left_eye', 'right_eye'], color: [255, 255, 51] },
43
+ 16: { link: ['right_eye', 'nose'], color: [255, 255, 51] },
44
+ 17: { link: ['left_eye', 'left_ear'], color: [255, 255, 51] },
45
+ 18: { link: ['right_eye', 'right_ear'], color: [255, 255, 51] },
46
+ 19: { link: ['left_ear', 'left_shoulder'], color: [255, 255, 51] },
47
+ 20: { link: ['right_ear', 'right_shoulder'], color: [255, 255, 51] },
48
+ },
49
+ } as const;
@@ -0,0 +1,71 @@
1
+ /**
2
+ * HALPE26 skeleton configuration
3
+ * 26 keypoints for body pose estimation with feet
4
+ */
5
+
6
+ export const halpe26 = {
7
+ keypoint_info: {
8
+ 0: { name: 'nose', id: 0, color: [51, 255, 255] },
9
+ 1: { name: 'left_eye', id: 1, color: [51, 255, 255] },
10
+ 2: { name: 'right_eye', id: 2, color: [51, 255, 255] },
11
+ 3: { name: 'left_ear', id: 3, color: [51, 255, 255] },
12
+ 4: { name: 'right_ear', id: 4, color: [51, 255, 255] },
13
+ 5: { name: 'left_shoulder', id: 5, color: [255, 51, 255] },
14
+ 6: { name: 'right_shoulder', id: 6, color: [255, 51, 255] },
15
+ 7: { name: 'left_elbow', id: 7, color: [255, 51, 255] },
16
+ 8: { name: 'right_elbow', id: 8, color: [255, 51, 255] },
17
+ 9: { name: 'left_wrist', id: 9, color: [255, 51, 255] },
18
+ 10: { name: 'right_wrist', id: 10, color: [255, 51, 255] },
19
+ 11: { name: 'left_hip', id: 11, color: [255, 255, 51] },
20
+ 12: { name: 'right_hip', id: 12, color: [255, 255, 51] },
21
+ 13: { name: 'left_knee', id: 13, color: [255, 255, 51] },
22
+ 14: { name: 'right_knee', id: 14, color: [255, 255, 51] },
23
+ 15: { name: 'left_ankle', id: 15, color: [255, 255, 51] },
24
+ 16: { name: 'right_ankle', id: 16, color: [255, 255, 51] },
25
+ 17: { name: 'head', id: 17, color: [51, 255, 255] },
26
+ 18: { name: 'neck', id: 18, color: [255, 255, 51] },
27
+ 19: { name: 'right_hip_corner', id: 19, color: [255, 255, 51] },
28
+ 20: { name: 'left_hip_corner', id: 20, color: [255, 255, 51] },
29
+ 21: { name: 'left_big_toe', id: 21, color: [255, 255, 51] },
30
+ 22: { name: 'left_small_toe', id: 22, color: [255, 255, 51] },
31
+ 23: { name: 'right_big_toe', id: 23, color: [255, 255, 51] },
32
+ 24: { name: 'right_small_toe', id: 24, color: [255, 255, 51] },
33
+ 25: { name: 'left_heel', id: 25, color: [255, 255, 51] },
34
+ 26: { name: 'right_heel', id: 26, color: [255, 255, 51] },
35
+ },
36
+ skeleton_info: {
37
+ 0: { link: ['left_ankle', 'left_knee'], color: [255, 51, 255] },
38
+ 1: { link: ['left_knee', 'left_hip'], color: [255, 51, 255] },
39
+ 2: { link: ['left_hip', 'right_hip'], color: [255, 255, 51] },
40
+ 3: { link: ['right_hip', 'right_knee'], color: [255, 51, 255] },
41
+ 4: { link: ['right_knee', 'right_ankle'], color: [255, 51, 255] },
42
+ 5: { link: ['left_hip', 'left_shoulder'], color: [255, 255, 51] },
43
+ 6: { link: ['left_shoulder', 'left_elbow'], color: [255, 255, 51] },
44
+ 7: { link: ['left_elbow', 'left_wrist'], color: [255, 255, 51] },
45
+ 8: { link: ['right_hip', 'right_shoulder'], color: [255, 255, 51] },
46
+ 9: { link: ['right_shoulder', 'right_elbow'], color: [255, 255, 51] },
47
+ 10: { link: ['right_elbow', 'right_wrist'], color: [255, 255, 51] },
48
+ 11: { link: ['left_shoulder', 'right_shoulder'], color: [255, 255, 51] },
49
+ 12: { link: ['nose', 'left_shoulder'], color: [255, 255, 51] },
50
+ 13: { link: ['nose', 'right_shoulder'], color: [255, 255, 51] },
51
+ 14: { link: ['nose', 'left_eye'], color: [255, 255, 51] },
52
+ 15: { link: ['left_eye', 'right_eye'], color: [255, 255, 51] },
53
+ 16: { link: ['right_eye', 'nose'], color: [255, 255, 51] },
54
+ 17: { link: ['left_eye', 'left_ear'], color: [255, 255, 51] },
55
+ 18: { link: ['right_eye', 'right_ear'], color: [255, 255, 51] },
56
+ 19: { link: ['left_ear', 'left_shoulder'], color: [255, 255, 51] },
57
+ 20: { link: ['right_ear', 'right_shoulder'], color: [255, 255, 51] },
58
+ 21: { link: ['nose', 'head'], color: [51, 255, 255] },
59
+ 22: { link: ['head', 'neck'], color: [255, 255, 51] },
60
+ 23: { link: ['neck', 'left_shoulder'], color: [255, 255, 51] },
61
+ 24: { link: ['neck', 'right_shoulder'], color: [255, 255, 51] },
62
+ 25: { link: ['neck', 'left_hip'], color: [255, 255, 51] },
63
+ 26: { link: ['neck', 'right_hip'], color: [255, 255, 51] },
64
+ 27: { link: ['left_ankle', 'left_big_toe'], color: [255, 255, 51] },
65
+ 28: { link: ['left_ankle', 'left_small_toe'], color: [255, 255, 51] },
66
+ 29: { link: ['left_ankle', 'left_heel'], color: [255, 255, 51] },
67
+ 30: { link: ['right_ankle', 'right_big_toe'], color: [255, 255, 51] },
68
+ 31: { link: ['right_ankle', 'right_small_toe'], color: [255, 255, 51] },
69
+ 32: { link: ['right_ankle', 'right_heel'], color: [255, 255, 51] },
70
+ },
71
+ } as const;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Hand21 skeleton configuration
3
+ * 21 keypoints for hand pose estimation
4
+ */
5
+
6
+ export const hand21 = {
7
+ keypoint_info: {
8
+ 0: { name: 'wrist', id: 0, color: [255, 128, 0] },
9
+ 1: { name: 'thumb_1', id: 1, color: [255, 128, 0] },
10
+ 2: { name: 'thumb_2', id: 2, color: [255, 128, 0] },
11
+ 3: { name: 'thumb_3', id: 3, color: [255, 128, 0] },
12
+ 4: { name: 'thumb_4', id: 4, color: [255, 128, 0] },
13
+ 5: { name: 'forefinger_1', id: 5, color: [255, 128, 0] },
14
+ 6: { name: 'forefinger_2', id: 6, color: [255, 128, 0] },
15
+ 7: { name: 'forefinger_3', id: 7, color: [255, 128, 0] },
16
+ 8: { name: 'forefinger_4', id: 8, color: [255, 128, 0] },
17
+ 9: { name: 'middle_finger_1', id: 9, color: [255, 128, 0] },
18
+ 10: { name: 'middle_finger_2', id: 10, color: [255, 128, 0] },
19
+ 11: { name: 'middle_finger_3', id: 11, color: [255, 128, 0] },
20
+ 12: { name: 'middle_finger_4', id: 12, color: [255, 128, 0] },
21
+ 13: { name: 'ring_finger_1', id: 13, color: [255, 128, 0] },
22
+ 14: { name: 'ring_finger_2', id: 14, color: [255, 128, 0] },
23
+ 15: { name: 'ring_finger_3', id: 15, color: [255, 128, 0] },
24
+ 16: { name: 'ring_finger_4', id: 16, color: [255, 128, 0] },
25
+ 17: { name: 'pinky_finger_1', id: 17, color: [255, 128, 0] },
26
+ 18: { name: 'pinky_finger_2', id: 18, color: [255, 128, 0] },
27
+ 19: { name: 'pinky_finger_3', id: 19, color: [255, 128, 0] },
28
+ 20: { name: 'pinky_finger_4', id: 20, color: [255, 128, 0] },
29
+ },
30
+ skeleton_info: {
31
+ 0: { link: ['wrist', 'thumb_1'], color: [255, 128, 0] },
32
+ 1: { link: ['thumb_1', 'thumb_2'], color: [255, 128, 0] },
33
+ 2: { link: ['thumb_2', 'thumb_3'], color: [255, 128, 0] },
34
+ 3: { link: ['thumb_3', 'thumb_4'], color: [255, 128, 0] },
35
+ 4: { link: ['wrist', 'forefinger_1'], color: [255, 128, 0] },
36
+ 5: { link: ['forefinger_1', 'forefinger_2'], color: [255, 128, 0] },
37
+ 6: { link: ['forefinger_2', 'forefinger_3'], color: [255, 128, 0] },
38
+ 7: { link: ['forefinger_3', 'forefinger_4'], color: [255, 128, 0] },
39
+ 8: { link: ['wrist', 'middle_finger_1'], color: [255, 128, 0] },
40
+ 9: { link: ['middle_finger_1', 'middle_finger_2'], color: [255, 128, 0] },
41
+ 10: { link: ['middle_finger_2', 'middle_finger_3'], color: [255, 128, 0] },
42
+ 11: { link: ['middle_finger_3', 'middle_finger_4'], color: [255, 128, 0] },
43
+ 12: { link: ['wrist', 'ring_finger_1'], color: [255, 128, 0] },
44
+ 13: { link: ['ring_finger_1', 'ring_finger_2'], color: [255, 128, 0] },
45
+ 14: { link: ['ring_finger_2', 'ring_finger_3'], color: [255, 128, 0] },
46
+ 15: { link: ['ring_finger_3', 'ring_finger_4'], color: [255, 128, 0] },
47
+ 16: { link: ['wrist', 'pinky_finger_1'], color: [255, 128, 0] },
48
+ 17: { link: ['pinky_finger_1', 'pinky_finger_2'], color: [255, 128, 0] },
49
+ 18: { link: ['pinky_finger_2', 'pinky_finger_3'], color: [255, 128, 0] },
50
+ 19: { link: ['pinky_finger_3', 'pinky_finger_4'], color: [255, 128, 0] },
51
+ },
52
+ } as const;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Skeleton configurations export
3
+ */
4
+
5
+ export { coco17 } from './coco17';
6
+ export { coco133 } from './coco133';
7
+ export { hand21 } from './hand21';
8
+ export { halpe26 } from './halpe26';
9
+ export { openpose18 } from './openpose18';
10
+ export { openpose134 } from './openpose134';
@@ -0,0 +1,125 @@
1
+ /**
2
+ * OpenPose134 skeleton configuration
3
+ * 134 keypoints for wholebody pose estimation (OpenPose style)
4
+ */
5
+
6
+ export const openpose134 = {
7
+ keypoint_info: {
8
+ // Body (0-17)
9
+ 0: { name: 'nose', id: 0, color: [255, 0, 0] },
10
+ 1: { name: 'neck', id: 1, color: [255, 85, 0] },
11
+ 2: { name: 'right_shoulder', id: 2, color: [255, 170, 0] },
12
+ 3: { name: 'right_elbow', id: 3, color: [255, 255, 0] },
13
+ 4: { name: 'right_wrist', id: 4, color: [170, 255, 0] },
14
+ 5: { name: 'left_shoulder', id: 5, color: [85, 255, 0] },
15
+ 6: { name: 'left_elbow', id: 6, color: [0, 255, 0] },
16
+ 7: { name: 'left_wrist', id: 7, color: [0, 255, 85] },
17
+ 8: { name: 'right_hip', id: 8, color: [0, 255, 170] },
18
+ 9: { name: 'right_knee', id: 9, color: [0, 255, 255] },
19
+ 10: { name: 'right_ankle', id: 10, color: [0, 170, 255] },
20
+ 11: { name: 'left_hip', id: 11, color: [0, 85, 255] },
21
+ 12: { name: 'left_knee', id: 12, color: [0, 0, 255] },
22
+ 13: { name: 'left_ankle', id: 13, color: [85, 0, 255] },
23
+ 14: { name: 'right_eye', id: 14, color: [170, 0, 255] },
24
+ 15: { name: 'left_eye', id: 15, color: [255, 0, 255] },
25
+ 16: { name: 'right_ear', id: 16, color: [255, 0, 170] },
26
+ 17: { name: 'left_ear', id: 17, color: [255, 0, 85] },
27
+ // Face (18-87) - 70 points
28
+ ...Object.fromEntries(
29
+ Array.from({ length: 70 }, (_, i) => [
30
+ i + 18,
31
+ { name: `face_${i}`, id: i + 18, color: [255, 255, 255] }
32
+ ])
33
+ ),
34
+ // Left hand (88-108) - 21 points
35
+ ...Object.fromEntries(
36
+ Array.from({ length: 21 }, (_, i) => [
37
+ i + 88,
38
+ { name: `left_hand_${i}`, id: i + 88, color: [255, 128, 0] }
39
+ ])
40
+ ),
41
+ // Right hand (109-129) - 21 points
42
+ ...Object.fromEntries(
43
+ Array.from({ length: 21 }, (_, i) => [
44
+ i + 109,
45
+ { name: `right_hand_${i}`, id: i + 109, color: [0, 128, 255] }
46
+ ])
47
+ ),
48
+ // Left foot (130-133) - 4 points
49
+ 130: { name: 'left_big_toe', id: 130, color: [0, 255, 128] },
50
+ 131: { name: 'left_small_toe', id: 131, color: [0, 255, 128] },
51
+ 132: { name: 'left_heel', id: 132, color: [0, 255, 128] },
52
+ 133: { name: 'left_foot_center', id: 133, color: [0, 255, 128] },
53
+ },
54
+ skeleton_info: {
55
+ // Body skeleton
56
+ 0: { link: ['neck', 'right_shoulder'], color: [255, 85, 0] },
57
+ 1: { link: ['neck', 'left_shoulder'], color: [255, 85, 0] },
58
+ 2: { link: ['right_shoulder', 'right_elbow'], color: [255, 170, 0] },
59
+ 3: { link: ['right_elbow', 'right_wrist'], color: [255, 255, 0] },
60
+ 4: { link: ['left_shoulder', 'left_elbow'], color: [85, 255, 0] },
61
+ 5: { link: ['left_elbow', 'left_wrist'], color: [0, 255, 0] },
62
+ 6: { link: ['neck', 'right_hip'], color: [255, 85, 0] },
63
+ 7: { link: ['right_hip', 'right_knee'], color: [0, 255, 170] },
64
+ 8: { link: ['right_knee', 'right_ankle'], color: [0, 255, 255] },
65
+ 9: { link: ['neck', 'left_hip'], color: [255, 85, 0] },
66
+ 10: { link: ['left_hip', 'left_knee'], color: [0, 85, 255] },
67
+ 11: { link: ['left_knee', 'left_ankle'], color: [0, 0, 255] },
68
+ 12: { link: ['nose', 'neck'], color: [255, 0, 0] },
69
+ 13: { link: ['nose', 'right_eye'], color: [255, 0, 0] },
70
+ 14: { link: ['nose', 'left_eye'], color: [255, 0, 0] },
71
+ 15: { link: ['right_eye', 'right_ear'], color: [170, 0, 255] },
72
+ 16: { link: ['left_eye', 'left_ear'], color: [255, 0, 255] },
73
+ 17: { link: ['right_shoulder', 'left_shoulder'], color: [255, 85, 0] },
74
+ 18: { link: ['right_hip', 'left_hip'], color: [255, 85, 0] },
75
+ // Face skeleton (simplified contour)
76
+ ...Object.fromEntries(
77
+ Array.from({ length: 17 }, (_, i) => [
78
+ i + 19,
79
+ { link: [`face_${i}`, `face_${(i + 1) % 17}`], color: [255, 255, 255] }
80
+ ])
81
+ ),
82
+ // Left hand skeleton
83
+ 36: { link: ['left_hand_0', 'left_hand_1'], color: [255, 128, 0] },
84
+ 37: { link: ['left_hand_1', 'left_hand_2'], color: [255, 128, 0] },
85
+ 38: { link: ['left_hand_2', 'left_hand_3'], color: [255, 128, 0] },
86
+ 39: { link: ['left_hand_3', 'left_hand_4'], color: [255, 128, 0] },
87
+ 40: { link: ['left_hand_0', 'left_hand_5'], color: [255, 128, 0] },
88
+ 41: { link: ['left_hand_5', 'left_hand_6'], color: [255, 128, 0] },
89
+ 42: { link: ['left_hand_6', 'left_hand_7'], color: [255, 128, 0] },
90
+ 43: { link: ['left_hand_7', 'left_hand_8'], color: [255, 128, 0] },
91
+ 44: { link: ['left_hand_0', 'left_hand_9'], color: [255, 128, 0] },
92
+ 45: { link: ['left_hand_9', 'left_hand_10'], color: [255, 128, 0] },
93
+ 46: { link: ['left_hand_10', 'left_hand_11'], color: [255, 128, 0] },
94
+ 47: { link: ['left_hand_11', 'left_hand_12'], color: [255, 128, 0] },
95
+ 48: { link: ['left_hand_0', 'left_hand_13'], color: [255, 128, 0] },
96
+ 49: { link: ['left_hand_13', 'left_hand_14'], color: [255, 128, 0] },
97
+ 50: { link: ['left_hand_14', 'left_hand_15'], color: [255, 128, 0] },
98
+ 51: { link: ['left_hand_15', 'left_hand_16'], color: [255, 128, 0] },
99
+ 52: { link: ['left_hand_0', 'left_hand_17'], color: [255, 128, 0] },
100
+ 53: { link: ['left_hand_17', 'left_hand_18'], color: [255, 128, 0] },
101
+ 54: { link: ['left_hand_18', 'left_hand_19'], color: [255, 128, 0] },
102
+ 55: { link: ['left_hand_19', 'left_hand_20'], color: [255, 128, 0] },
103
+ // Right hand skeleton
104
+ 56: { link: ['right_hand_0', 'right_hand_1'], color: [0, 128, 255] },
105
+ 57: { link: ['right_hand_1', 'right_hand_2'], color: [0, 128, 255] },
106
+ 58: { link: ['right_hand_2', 'right_hand_3'], color: [0, 128, 255] },
107
+ 59: { link: ['right_hand_3', 'right_hand_4'], color: [0, 128, 255] },
108
+ 60: { link: ['right_hand_0', 'right_hand_5'], color: [0, 128, 255] },
109
+ 61: { link: ['right_hand_5', 'right_hand_6'], color: [0, 128, 255] },
110
+ 62: { link: ['right_hand_6', 'right_hand_7'], color: [0, 128, 255] },
111
+ 63: { link: ['right_hand_7', 'right_hand_8'], color: [0, 128, 255] },
112
+ 64: { link: ['right_hand_0', 'right_hand_9'], color: [0, 128, 255] },
113
+ 65: { link: ['right_hand_9', 'right_hand_10'], color: [0, 128, 255] },
114
+ 66: { link: ['right_hand_10', 'right_hand_11'], color: [0, 128, 255] },
115
+ 67: { link: ['right_hand_11', 'right_hand_12'], color: [0, 128, 255] },
116
+ 68: { link: ['right_hand_0', 'right_hand_13'], color: [0, 128, 255] },
117
+ 69: { link: ['right_hand_13', 'right_hand_14'], color: [0, 128, 255] },
118
+ 70: { link: ['right_hand_14', 'right_hand_15'], color: [0, 128, 255] },
119
+ 71: { link: ['right_hand_15', 'right_hand_16'], color: [0, 128, 255] },
120
+ 72: { link: ['right_hand_0', 'right_hand_17'], color: [0, 128, 255] },
121
+ 73: { link: ['right_hand_17', 'right_hand_18'], color: [0, 128, 255] },
122
+ 74: { link: ['right_hand_18', 'right_hand_19'], color: [0, 128, 255] },
123
+ 75: { link: ['right_hand_19', 'right_hand_20'], color: [0, 128, 255] },
124
+ },
125
+ } as const;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * OpenPose18 skeleton configuration
3
+ * 18 keypoints for body pose estimation (OpenPose style)
4
+ */
5
+
6
+ export const openpose18 = {
7
+ keypoint_info: {
8
+ 0: { name: 'nose', id: 0, color: [255, 0, 0] },
9
+ 1: { name: 'neck', id: 1, color: [255, 85, 0] },
10
+ 2: { name: 'right_shoulder', id: 2, color: [255, 170, 0] },
11
+ 3: { name: 'right_elbow', id: 3, color: [255, 255, 0] },
12
+ 4: { name: 'right_wrist', id: 4, color: [170, 255, 0] },
13
+ 5: { name: 'left_shoulder', id: 5, color: [85, 255, 0] },
14
+ 6: { name: 'left_elbow', id: 6, color: [0, 255, 0] },
15
+ 7: { name: 'left_wrist', id: 7, color: [0, 255, 85] },
16
+ 8: { name: 'right_hip', id: 8, color: [0, 255, 170] },
17
+ 9: { name: 'right_knee', id: 9, color: [0, 255, 255] },
18
+ 10: { name: 'right_ankle', id: 10, color: [0, 170, 255] },
19
+ 11: { name: 'left_hip', id: 11, color: [0, 85, 255] },
20
+ 12: { name: 'left_knee', id: 12, color: [0, 0, 255] },
21
+ 13: { name: 'left_ankle', id: 13, color: [85, 0, 255] },
22
+ 14: { name: 'right_eye', id: 14, color: [170, 0, 255] },
23
+ 15: { name: 'left_eye', id: 15, color: [255, 0, 255] },
24
+ 16: { name: 'right_ear', id: 16, color: [255, 0, 170] },
25
+ 17: { name: 'left_ear', id: 17, color: [255, 0, 85] },
26
+ },
27
+ skeleton_info: {
28
+ 0: { link: ['neck', 'right_shoulder'], color: [255, 85, 0] },
29
+ 1: { link: ['neck', 'left_shoulder'], color: [255, 85, 0] },
30
+ 2: { link: ['right_shoulder', 'right_elbow'], color: [255, 170, 0] },
31
+ 3: { link: ['right_elbow', 'right_wrist'], color: [255, 255, 0] },
32
+ 4: { link: ['left_shoulder', 'left_elbow'], color: [85, 255, 0] },
33
+ 5: { link: ['left_elbow', 'left_wrist'], color: [0, 255, 0] },
34
+ 6: { link: ['neck', 'right_hip'], color: [255, 85, 0] },
35
+ 7: { link: ['right_hip', 'right_knee'], color: [0, 255, 170] },
36
+ 8: { link: ['right_knee', 'right_ankle'], color: [0, 255, 255] },
37
+ 9: { link: ['neck', 'left_hip'], color: [255, 85, 0] },
38
+ 10: { link: ['left_hip', 'left_knee'], color: [0, 85, 255] },
39
+ 11: { link: ['left_knee', 'left_ankle'], color: [0, 0, 255] },
40
+ 12: { link: ['nose', 'neck'], color: [255, 0, 0] },
41
+ 13: { link: ['nose', 'right_eye'], color: [255, 0, 0] },
42
+ 14: { link: ['nose', 'left_eye'], color: [255, 0, 0] },
43
+ 15: { link: ['right_eye', 'right_ear'], color: [170, 0, 255] },
44
+ 16: { link: ['left_eye', 'left_ear'], color: [255, 0, 255] },
45
+ 17: { link: ['right_shoulder', 'left_shoulder'], color: [255, 85, 0] },
46
+ 18: { link: ['right_hip', 'left_hip'], color: [255, 85, 0] },
47
+ },
48
+ } as const;
package/tsconfig.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "lib": [
5
+ "ES2020",
6
+ "DOM",
7
+ "DOM.Iterable"
8
+ ],
9
+
10
+ "module": "ESNext",
11
+ "moduleResolution": "bundler",
12
+ "declaration": true,
13
+ "declarationMap": true,
14
+ "outDir": "./dist",
15
+ "rootDir": "./src",
16
+ "strict": true,
17
+ "esModuleInterop": true,
18
+ "skipLibCheck": true,
19
+ "forceConsistentCasingInFileNames": true,
20
+ "resolveJsonModule": true,
21
+ "isolatedModules": true
22
+ },
23
+ "include": [
24
+ "src/**/*",
25
+
26
+ ],
27
+ "exclude": [
28
+ "node_modules",
29
+ "dist",
30
+ "playground"
31
+ ]
32
+ }