ai_creativity_design/Expressive_Movement/main.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;
        console.log(pose);
        for (let j = 0; j < pose.keypoints.length; j++) {
            let keypoint = pose.keypoints[j];
            if (keypoint.score > 0.2) {
                fill(75, 0, 130);
                noStroke();
                ellipse(keypoint.position.x, keypoint.position.y, 30, 30);
            }
        }
    }
}
function drawKeypoints ( ) { for ( let i = 0 ; i < poses . length ; i ++ ) { let pose = poses [ i ] . pose ; console . log ( pose ) ; for ( let j = 0 ; j < pose . keypoints . length ; j ++ ) { let keypoint = pose . keypoints [ j ] ; if ( keypoint . score > 0.2 ) { fill ( 75 , 0 , 130 ) ; noStroke ( ) ; ellipse ( keypoint . position . x , keypoint . position . y , 30 , 30 ) ; } } } }
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