Created
September 23, 2020 09:50
-
-
Save ntakouris/124a3b774324a24af0cf9bc0da069281 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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