20220105_002_pose_net_sample/sketch.js
// A function to draw ellipses over the detected keypoints
A function to draw ellipses over the detected keypoints
A function to draw ellipses over the detected keypoints
function drawKeypoints() {
  for (let i = 0; i < poses.length; i++) {
    let pose = poses[i].pose;
    for (let j = 0; j < pose.keypoints.length; j++) {
      let keypoint = pose.keypoints[j];
      if (keypoint.score > 0.2) {
        fill(255, 0, 0);
        noStroke();
        ellipse(
          keypoint.position.x * scale_width,
          keypoint.position.y * scale_height,
          20 * scale_mean,
          20 * scale_mean
        );
      }
    }
  }
}
function drawKeypoints ( ) { for ( let i = 0 ; i < poses . length ; i ++ ) { let pose = poses [ i ] . pose ; for ( let j = 0 ; j < pose . keypoints . length ; j ++ ) { let keypoint = pose . keypoints [ j ] ; if ( keypoint . score > 0.2 ) { fill ( 255 , 0 , 0 ) ; noStroke ( ) ; ellipse ( keypoint . position . x * scale_width , keypoint . position . y * scale_height , 20 * scale_mean , 20 * scale_mean ) ; } } } }
A function to draw ellipses over the detected keypoints
A function to draw ellipses over the detected keypoints
// Loop through all the poses detected // For each pose detected, loop through all the keypoints // A keypoint is an object describing a body part (like rightArm or leftShoulder) // Only draw an ellipse is the pose probability is bigger than 0.2