xxxxxxxxxx
65
// easeBodyPose is based on this:
// https://docs.ml5js.org/#/reference/bodypose
// how to use:
// "person": access individual body part positions with the 'person' object.
// for instance: person.nose.x, person.nose.y
// see end of file for all available body parts
let bodyPose;
let video;
function preload() {
bodyPose = ml5.bodyPose("MoveNet");
}
function setup() {
createCanvas(640, 480);
video = createCapture(VIDEO);
video.size(width, height);
video.hide();
// start
startBodyPose(video, bodyPose);
}
function draw() {
background(220);
// display the video
image(video, 0, 0);
fill(255, 0, 0);
// an example of how to use one of the above body parts
circle(person.nose.x, person.nose.y, 50);
}
// these are the available variables...
// console.log(person) will show you everything in the console.
// for instance:
// person.nose.x
// list of all variables
// box
// confidence
// left_ankle
// left_ear
// left_elbow
// left_eye
// left_hip
// left_knee
// left_shoulder
// left_wrist
// nose
// right_ankle
// right_ear
// right_elbow
// right_eye
// right_hip
// right_knee
// right_shoulder
// right_wrist