Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using a pretrained ML model in JavaScript using TensorFlow.js
<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
You can’t perform that action at this time.