Wolfram Neural Net Repository
Immediate Computable Access to Neural Net Models
Determine the 2D projection of 3D keypoints from a facial image
Developed in 2017 at the Computer Vision Laboratory at the University of Nottingham, this net predicts the locations of the 2D projections of 68 3D keypoints (17 for face contour, 10 for eyebrows, 9 for nose, 12 for eyes, 20 for mouth) from a facial image. For each keypoint, a heat map for its location is produced. Its complex architecture features a combination of hourglass modules and multiscale parallel blocks.
Number of layers: 967 | Parameter count: 23,874,320 | Trained size: 97 MB |
This model achieves, respectively, 73.5%, 74.6% and 68.8% AUC (Area Under Curve) score for yaw angles of 0°-30°, 30°-60° and 60°-90° on the LS3D-W dataset.
Get the pre-trained net:
In[1]:= | ![]() |
Out[1]= | ![]() |
This net outputs a 64x64 heat map for each of the 68 landmarks:
In[2]:= | ![]() |
Obtain the dimensions of the heat maps:
In[3]:= | ![]() |
Out[3]= | ![]() |
Visualize heat maps 1, 12 and 29:
In[4]:= | ![]() |
Out[4]= | ![]() |
Write an evaluation function that picks the maximum position of each heat map and returns a list of landmark positions:
In[5]:= | ![]() |
Get the landmarks using the evaluation function. Coordinates are rescaled to the input image size so that the bottom-left corner is identified by {0, 0} and the top-right corner by {1, 1}:
In[6]:= | ![]() |
Out[6]= | ![]() |
Group landmarks associated with different facial features by colors:
In[7]:= | ![]() |
Visualize the landmarks:
In[8]:= | ![]() |
Out[8]= | ![]() |
Get an image:
In[9]:= | ![]() |
Crop the image at various sizes:
In[10]:= | ![]() |
Out[10]= | ![]() |
Inspect the network performance across the crops:
In[11]:= | ![]() |
Out[11]= | ![]() |
Inspect the number of parameters of all arrays in the net:
In[12]:= | ![]() |
Out[12]= | ![]() |
Obtain the total number of parameters:
In[13]:= | ![]() |
Out[13]= | ![]() |
Obtain the layer type counts:
In[14]:= | ![]() |
Out[14]= | ![]() |
Display the summary graphic:
In[15]:= | ![]() |
Out[15]= | ![]() |
Wolfram Language 11.2 (September 2017) or above