Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to mediapipe facemesh #10

Open
jthawme opened this issue Sep 12, 2022 · 1 comment
Open

Update to mediapipe facemesh #10

jthawme opened this issue Sep 12, 2022 · 1 comment

Comments

@jthawme
Copy link

jthawme commented Sep 12, 2022

As it looks the tfjs facemesh model is deprecated, do you know of any idea of how to use this with MediaPipe's facemesh instead?

https://google.github.io/mediapipe/solutions/face_mesh.html

Any guidance would be appreciated, thanks so much

@jthawme
Copy link
Author

jthawme commented Sep 13, 2022

I wouldn't feel confident enough for a PR on this, but to drop some further information, it looks very similar in a lot of ways, but the results from the facemesh library linked above come in like

function onResults(results) {
  const {multiFaceLandmarks} = results;
  
  // [
  //   ...468 items
  //   { x: 0.4, y: 0.6, z: -0.1 }
  // ]
}

They're all values from 0-1, except z I believe

Atm i am exploring using it by doing

geo.update({
  scaledMesh: multiFaceLandmarks[0].map(vec => Object.values(vec))
})

But its not 100% correct yet, but works without erroring and does create a mesh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant