Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get both positions x and y to be 0 in the response of tensorflow.js posenet?

Initialization of posenet

const net = await posenet.load();

const pose = await net.estimateSinglePose(videoElement, {
  flipHorizontal: false
});

Output

part: "leftEye"
position: {x: 0, y: 0}
score: 0.9931495785713196

My question is I always get position 0,0 for every body parts even though the score is high.

like image 989
bikram Avatar asked Dec 07 '25 05:12

bikram


1 Answers

I figured out the solution. Make sure you add width and height to source element (image or video). Notice that if you add width and height from css it will not work, you need to add it programmatically.

 video = document.getElementById("video");

 //must add the following
 video.width = 500;
 video.height = 500;
like image 125
bikram Avatar answered Dec 10 '25 18:12

bikram