0
$\begingroup$

Under the hood, FacialFeatures uses the net-model ResNet-101 Trained on Augmented Casia WebFace Data. I would like to see a tutorial-style answer on how one would implement the downvalues of FacialFeatures[] in python by exporting the network?

Alternatively, using Mathematica behind a flask app to serve http requests with images would be another answer.

$\endgroup$
  • 2
    $\begingroup$ Have you tried simply finding the network implemented in Pytorch or any other python-compatible Neural Networks library? Exporting the network out of Mathematica has a host of gotchas and difficulties that may not be worth it since the network was almost certainly implemented in Python in the first place - eg here: github.com/davidsandberg/facenet $\endgroup$ – Carl Lange Aug 2 at 18:14
  • $\begingroup$ But that one's a year old. I haven't found one that does all the things FacialFeatures[] does... $\endgroup$ – user5601 Aug 2 at 23:17
  • $\begingroup$ If external function could be used in a webserver behind some queue then that would work too, instead of exporting stuff and code to python... $\endgroup$ – user5601 Aug 2 at 23:18
  • 1
    $\begingroup$ The NetModel you're talking about is also a year old: resources.wolframcloud.com/NeuralNetRepository/resources/… (at the bottom). The source website is also valuable. $\endgroup$ – Carl Lange Aug 2 at 23:43
  • $\begingroup$ You could try something like CloudDeploy[FormPage[{"i" -> "Image"}, FacialFeatures[#i, "Age"] &]] (or APIFunction or similar. I don't know that you will get great results this way though - FacialFeatures is an expensive function.) $\endgroup$ – Carl Lange Aug 2 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.