Created
October 23, 2019 23:23
-
-
Save sandeepngupta/f37a40f912abb5a51f9a4f21587347b4 to your computer and use it in GitHub Desktop.
Using a pretrained ML model in JavaScript using TensorFlow.js
This file contains 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
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/posenet"></script> | |
<img id="tennis" src="tennis.jpg"/> | |
<script> | |
async function run() { | |
const net = await posenet.load(); | |
const image = document.getElementById('tennis'); | |
const pose = await net.estimateSinglePose(image); | |
console.log(pose); | |
} | |
run(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment