From 1d3c8dfd20196d6ea7eae222ea7913df6a61a5f6 Mon Sep 17 00:00:00 2001 From: Ziyuan Lin Date: Tue, 29 Oct 2024 00:40:22 -0400 Subject: [PATCH 1/3] add getConnections method --- examples/bodyPose-skeleton/sketch.js | 4 ++-- src/BodyPose/index.js | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/examples/bodyPose-skeleton/sketch.js b/examples/bodyPose-skeleton/sketch.js index 18527d2d..0e657740 100644 --- a/examples/bodyPose-skeleton/sketch.js +++ b/examples/bodyPose-skeleton/sketch.js @@ -26,8 +26,8 @@ function setup() { // Start detecting poses in the webcam video bodyPose.detectStart(video, gotPoses); - // Get the skeleton connection information - connections = bodyPose.getSkeleton(); + // Get the skeletal connection information + connections = bodyPose.getConnections(); } function draw() { diff --git a/src/BodyPose/index.js b/src/BodyPose/index.js index fb4fc438..f192123c 100644 --- a/src/BodyPose/index.js +++ b/src/BodyPose/index.js @@ -513,11 +513,11 @@ class BodyPose { } /** - * Returns the skeleton connections pairs for the model. + * Returns the skeletal connections pairs for the model. * @returns {number[][]} an array of pairs of indices containing the connected keypoints. * @public */ - getSkeleton() { + getConnections() { if (this.modelName === "BlazePose") { return poseDetection.util.getAdjacentPairs( poseDetection.SupportedModels.BlazePose @@ -528,6 +528,17 @@ class BodyPose { ); } } + + /** + * Returns the skeletal connections pairs for the model. + * An alias for `getConnections`. This method is deprecated and will be removed in the future. + * @returns {number[][]} an array of pairs of indices containing the connected keypoints. + * @public + * @deprecated + */ + getSkeleton() { + return this.getConnections(); + } } /** From 93e856da1895e1a369fc145647ca67c6067cce26 Mon Sep 17 00:00:00 2001 From: Ziyuan Lin Date: Tue, 29 Oct 2024 20:41:43 -0400 Subject: [PATCH 2/3] rename example --- .../index.html | 0 .../sketch.js | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename examples/{bodyPose-skeleton => bodyPose-skeletal-connections}/index.html (100%) rename examples/{bodyPose-skeleton => bodyPose-skeletal-connections}/sketch.js (100%) diff --git a/examples/bodyPose-skeleton/index.html b/examples/bodyPose-skeletal-connections/index.html similarity index 100% rename from examples/bodyPose-skeleton/index.html rename to examples/bodyPose-skeletal-connections/index.html diff --git a/examples/bodyPose-skeleton/sketch.js b/examples/bodyPose-skeletal-connections/sketch.js similarity index 100% rename from examples/bodyPose-skeleton/sketch.js rename to examples/bodyPose-skeletal-connections/sketch.js From 83eb1fb16b87da74a16e85e28bf67af41b7bf26b Mon Sep 17 00:00:00 2001 From: Ziyuan Lin Date: Wed, 30 Oct 2024 13:14:34 -0400 Subject: [PATCH 3/3] remove deprecation comment --- src/BodyPose/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/BodyPose/index.js b/src/BodyPose/index.js index f192123c..e1efe833 100644 --- a/src/BodyPose/index.js +++ b/src/BodyPose/index.js @@ -531,10 +531,9 @@ class BodyPose { /** * Returns the skeletal connections pairs for the model. - * An alias for `getConnections`. This method is deprecated and will be removed in the future. + * An alias for `getConnections`. * @returns {number[][]} an array of pairs of indices containing the connected keypoints. * @public - * @deprecated */ getSkeleton() { return this.getConnections();