Skip to content

Commit

Permalink
BlazePose named 3d keypoints (#215)
Browse files Browse the repository at this point in the history
* remove 2d z value

* add 3d values
  • Loading branch information
ziyuan-linn authored Oct 11, 2024
1 parent 0e66eae commit a7a8646
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/BodyPose/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,22 @@ class BodyPose {
y: keypoint.y,
confidence: keypoint.confidence,
};
if (keypoint.z) pose[keypoint.name].z = keypoint.z;
});

// Add the 3d keypoints if in BlazePose mode
if (pose.keypoints3D) {
pose.keypoints3D.forEach((keypoint) => {
pose[keypoint.name] = {
...pose[keypoint.name],
keypoint3D: {
x: keypoint.x,
y: keypoint.y,
z: keypoint.z,
confidence: keypoint.confidence,
},
};
});
}
});
}

Expand Down

0 comments on commit a7a8646

Please sign in to comment.