Skip to content

Commit 5caa7a2

Browse files
authored
add getConnections method and deprecate getSkeleton for bodyPose (#227)
* add getConnections method * rename example * remove deprecation comment
1 parent 308b786 commit 5caa7a2

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed
File renamed without changes.

examples/bodyPose-skeleton/sketch.js renamed to examples/bodyPose-skeletal-connections/sketch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ function setup() {
2626

2727
// Start detecting poses in the webcam video
2828
bodyPose.detectStart(video, gotPoses);
29-
// Get the skeleton connection information
30-
connections = bodyPose.getSkeleton();
29+
// Get the skeletal connection information
30+
connections = bodyPose.getConnections();
3131
}
3232

3333
function draw() {

src/BodyPose/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,11 @@ class BodyPose {
513513
}
514514

515515
/**
516-
* Returns the skeleton connections pairs for the model.
516+
* Returns the skeletal connections pairs for the model.
517517
* @returns {number[][]} an array of pairs of indices containing the connected keypoints.
518518
* @public
519519
*/
520-
getSkeleton() {
520+
getConnections() {
521521
if (this.modelName === "BlazePose") {
522522
return poseDetection.util.getAdjacentPairs(
523523
poseDetection.SupportedModels.BlazePose
@@ -528,6 +528,16 @@ class BodyPose {
528528
);
529529
}
530530
}
531+
532+
/**
533+
* Returns the skeletal connections pairs for the model.
534+
* An alias for `getConnections`.
535+
* @returns {number[][]} an array of pairs of indices containing the connected keypoints.
536+
* @public
537+
*/
538+
getSkeleton() {
539+
return this.getConnections();
540+
}
531541
}
532542

533543
/**

0 commit comments

Comments
 (0)