Created
July 15, 2021 17:06
-
-
Save javierluraschi/20f08b9093fcddf3fe8706addf4192e4 to your computer and use it in GitHub Desktop.
PoseNet with tensorflow.js and Elon image
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> | |
<body> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/posenet"></script> | |
<img id='pose' src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWiAH3AABABkAAwApADlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA/AAAAF5jcHJ0AAABXAAAAAt3dHB0AAABaAAAABRia3B0AAABfAAAABRyWFlaAAABkAAAABRnWFlaAAABpAAAABRiWFlaAAABuAAAABRyVFJDAAABzAAAAEBnVFJDAAABzAAAAEBiVFJDAAABzAAAAEBkZXNjAAAAAAAAAANjMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0ZXh0AAAAAEZCAABYWVogAAAAAAAA9tYAAQAAAADTLVhZWiAAAAAAAAADFgAAAzMAAAKkWFlaIAAAAAAAAG+iAAA49QAAA5BYWVogAAAAAAAAYpkAALeFAAAY2lhZWiAAAAAAAAAkoAAAD4QAALbPY3VydgAAAAAAAAAaAAAAywHJA2MFkghrC/YQPxVRGzQh8SmQMhg7kkYFUXdd7WtwegWJsZp8rGm/fdPD6TD////+ACVSZXNpemVkIG9uIGh0dHBzOi8vZXpnaWY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/YIP+NH0Lhf+gh/oKaNuObjWIA/pwe9gUgx6vaDrEdDvGusGCYZ/oYf6SoK/B8Nhw6qkbRxtcyF7gQDoQDZNL7PNCNUlkpSLTAQhCASoR4KBwTgVHc3UsAvI26D0DoEyrgoahk8EkcD3Nkic9tsxtY28gusB7Fm9GqltR0fo5HuBc1mRxPNpI+S0jNEPtBVILoBTfSYb2DgT3p4cwi4IUUAhLcJpLOYTS9o4jzQPuEKB1RE0+tKweKEB9XyCq4qwSYZUNY27stwGjUkEFCFVx+wuF6YdD1nquIJIPDUq0XN5oQpDLuVJmbzT2uCEKshzWOFxYFRXbzCEKAu37w80yZsc0EsRcLPY5p8QQhCEeMnvSIQqpwAS2QhRShNOiEIBu5T4jaQHtQhB6V0OqcuBZC1ziyeQCw4XB+a1nukfc5co/EQhCIi6sg3zxjuSmQt0Etu4IQgTrucr3eNvgnAg6iC57r/ABQhEPayY+zAGjmSAhCEV//Z" alt="" /> | |
<div id='details'></div> | |
<script> | |
var imageElement = document.getElementById('pose'); | |
posenet.load().then(function(net) { | |
const pose = net.estimateSinglePose(imageElement); | |
return pose; | |
}).then(function(pose){ | |
document.getElementById('details').innerText = JSON.stringify(pose); | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment