Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created September 23, 2020 09:56
Show Gist options
  • Save ntakouris/6ca8c9e71c1c811a8be16472d45a3928 to your computer and use it in GitHub Desktop.
Save ntakouris/6ca8c9e71c1c811a8be16472d45a3928 to your computer and use it in GitHub Desktop.
async function poseHandler(pose) {
l_hip = pose.keypoints[11];
r_hip = pose.keypoints[12];
hip = undefined;
if (l_hip && !r_hip) {
hip = l_hip;
}else if (r_hip && !l_hip) {
hip = r_hip;
}else{
if (l_hip.score > r_hip.score) {
hip = l_hip;
} else {
hip = r_hip;
}
}
if (!hip || hip.score < 0.6) {
// no hip found
return
}
// ..
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment