Last active
May 22, 2021 02:08
-
-
Save silphire/8ba556ff70d4830d65e882c69e2086bd to your computer and use it in GitHub Desktop.
test code of tensorflow.js with BlazePose
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
<html> | |
<head> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core"></script> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-converter"></script> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-webgl"></script> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/pose-detection"></script> | |
</head> | |
<body> | |
<img id="image" src="./image.jpg"> | |
<script> | |
window.onload = async () => { | |
const detector = await poseDetection.createDetector( | |
poseDetection.SupportedModels.BlazePose, | |
{runtime: 'tfjs', modelType:'lite'} | |
); | |
const image = document.getElementById('image'); | |
poses = await detector.estimatePoses(image); | |
console.log(poses[0]); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment