Skip to content

Commit 630da82

Browse files
Delete the unused BlazePose z property (#218)
* switch runtime to tfjs * remove z property and code style change --------- Co-authored-by: ziyuan-linn <[email protected]>
1 parent fcf5450 commit 630da82

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/BodyPose/index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,11 @@ class BodyPose {
465465
addKeypoints(poses) {
466466
poses.forEach((pose) => {
467467
pose.keypoints.forEach((keypoint) => {
468+
// Remove the z property that is not documented
469+
if (keypoint.z) {
470+
delete keypoint.z;
471+
}
472+
468473
pose[keypoint.name] = {
469474
x: keypoint.x,
470475
y: keypoint.y,
@@ -475,14 +480,11 @@ class BodyPose {
475480
// Add the 3d keypoints if in BlazePose mode
476481
if (pose.keypoints3D) {
477482
pose.keypoints3D.forEach((keypoint) => {
478-
pose[keypoint.name] = {
479-
...pose[keypoint.name],
480-
keypoint3D: {
481-
x: keypoint.x,
482-
y: keypoint.y,
483-
z: keypoint.z,
484-
confidence: keypoint.confidence,
485-
},
483+
pose[keypoint.name].keypoint3D = {
484+
x: keypoint.x,
485+
y: keypoint.y,
486+
z: keypoint.z,
487+
confidence: keypoint.confidence,
486488
};
487489
});
488490
}

0 commit comments

Comments
 (0)