Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created September 23, 2020 09:50
Show Gist options
  • Save ntakouris/124a3b774324a24af0cf9bc0da069281 to your computer and use it in GitHub Desktop.
Save ntakouris/124a3b774324a24af0cf9bc0da069281 to your computer and use it in GitHub Desktop.
var imageElement = document.getElementById('webcam');
imageElement.width = 640 // css is not enough for h/w
imageElement.height = 480 // add those here so that posenet produces non-zero outputs
async function poseHandler(pose) {
// do stuff
}
imageElement.addEventListener('loadeddata', async (event) => {
const net = await posenet.load()
while(recording) {
const pose = await net.estimateSinglePose(imageElement, {
flipHorizontal: true
});
await poseHandler(pose);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment