wasabia / three_dart

three.js rewrite by Dart, Dart 3D library. an easy to use, lightweight, cross-platform, general purpose 3D library.
MIT License
450 stars 80 forks source link

face tracking #143

Open DanteAlucard98 opened 1 year ago

DanteAlucard98 commented 1 year ago

Hello bro, i have a question, with this proyect Can you do face tracking like snapshat or tiktok ?

Knightro63 commented 1 year ago

Hi @DanteAlucard98,

Face tracing is possible with a couple of repos on pub.dev, but it is not directly in this package since this package is only for 3d viewing and some model manipulation. Below are some apks I have used for other projects that might help in your case.

https://pub.dev/packages/tflite_flutter using BlazeFace model for ios and android

https://pub.dev/packages/apple_vision_face this is only for mac

https://pub.dev/packages/google_mlkit_face_detection for ios and android

https://pub.dev/packages/google_mlkit_face_mesh_detection for ios and android

If you add a face mesh and attach the points from the packages to your model correctly you should have a basic head and face movement. This will not have all three axis since it is only taking in a 2D image, so you will have to use some of the fixed points on the face to determine quaternization. e.g.(using the eyes and nose distances to determined if the face is turned).

Hope this helps