xxxxxxxxxx
17
let capture;
let poseNet; // paste url into html under script
function setup() {
createCanvas(500, 500);
capture = createCapture(VIDEO);
capture.hide(); // it doesent put an extra webcam canvas it hides it
poseNet = ml5.poseNet(capture,modelLoaded);
}
function draw() {
let aspectRatio = capture.height/capture.width;
//aspect ratio to let webcam size same as canvas without it it will be distorted
image(capture, 0, 0, width, width * aspectRatio);
// filter(GRAY);
}