vladmandic / face-api

FaceAPI: AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS
https://vladmandic.github.io/face-api/demo/webcam.html
MIT License
830 stars 149 forks source link

Export the models to TensorFlow #95

Closed yoch closed 2 years ago

yoch commented 2 years ago

Hi,

This is not an issue but a question, I couldn't find where to ask it.

I would like to be able to use the face detection models in TensorFlow (python). Is this possible to convert them in SavedModel or Keras format ? And how to do that ?

Thank you

vladmandic commented 2 years ago

traditional TFJS GraphModel could be converted to TF SavedModel using a 3rd party utility like https://github.com/patlevin/tfjs-to-tf, but in case of FaceAPI core of the models are implemented in JS while weights provided are only weights, not fully enclosed models - so there is no way to convert that to Python without re-implementing everything manually.

But there are plenty of other models that do the job that can be converted.
Take a look at my other library https://github.com/vladmandic/human - models it is using are fully enclosed and could be converted.

yoch commented 2 years ago

OK, thank you !

I already see that you are using MediaPipe models, and I'll take a closer look.