I am using Googles MoveNet for my pose estimation model. The prediction works perfect, but I want to draw rectangles on the key points using the canvas function. I tried the below code but it is not working. It doesn't throw any error either.
const detectpose = async () => {
const poses = await detector.estimatePoses(video, false);
console.log(poses);
ctx.drawImage(video, 0, 0, 600, 400);
poses.forEach((pred) => {
const key = pred.keypoints;
for (let i = 0; i < key.length; i++) {
const x = key[i][0];
const y = key[i][1];
ctx.beginPath();
ctx.rect(x, y, 40, 40);
ctx.fillStyle = "blue";
ctx.fill();
}
});