browser_client/examples/example4_posenet_curves_simple/sketch.js
// A function to mirror the pose for testing with one person
A function to mirror the pose for testing with one person
A function to mirror the pose for testing with one person
function mirrorPose(pose) {
  for (let j = 0; j < pose.keypoints.length; j++) {
    const keypoint = pose.keypoints[j];
    keypoint.position.x = width - keypoint.position.x;
  }
}
function mirrorPose ( pose ) { for ( let j = 0 ; j < pose . keypoints . length ; j ++ ) { const keypoint = pose . keypoints [ j ] ; keypoint . position . x = width - keypoint . position . x ; } }
A function to mirror the pose for testing with one person
A function to mirror the pose for testing with one person
// Loop through all keypoints // Get the keypoint // A keypoint is an object describing a body part (like rightArm or leftShoulder) // Reverse the keypoint by subtracting the x from the width