It works using AI that has already been trained on how to analyze a human face. The UK-based research team inputted multiple images of human faces, along with their 3D models, into the system. Using a Convolutional Neural Network (or CNN), their software is able to map 2D pixels to three-dimensional coordinates on the face, regardless of expression or lighting condition.
They even have a nifty tool that allows you to try out your own facial reconstruction. Check out Idris Elba.
And Audrey Hepburn.
It's not difficult to imagine the possibilities for an AI with this kind of capability. From being able to upload an image of yourself to create an online avatar to virtual makeup try-on, there are many applications for this. But, as the team points out in their paper, there's still a long way to go before this technology is perfected.