Facial keypoints and triangulation mesh

For this part, I implemented simple code using GINPUT that allowed me to get matching keypoints for two images. And I would then use Delaunay triangulation on one image to get the triangles to use for both images.
Here is the two images with triangulations:

Midway face and original images

For this part, I actually just used the morph code and set the cross dissolve and warp to 0.5.
Two original images:

And the morph:

Morph sequence GIF

For this part, I created a morph function that would iterate over triangles, compute the transform of the triangle, then inverse warp the warped triangle's polygon and sample the appropriate points (using clipping and whatnot when necessary to prevent crashes). It was tricky to get the vectorization right and account for plt and images having different (XY vs Row-Col) coordinate systems.
Here is the result:

Mean face of a population and faces warped into average

I used the imm_face_db. I had to add points for the corners so that all of the image would be warped.
Here is what the faces with polygons look like:

I got the mean face by taking the mean points, triangulating, and using it to morph shape to the average face and finally cross dissolve all the faces:

Now, we can try morphing some faces to the mean face shape:

Average face and my geometry

For this part, I took an existing ASF file and modified it manually to roughly match my face:

Then, I morphed myself to average shape:

Then, I morphed average face to my shape:

Caricatures

here, I just tried warping my face to average face but with warp factor of 2x:

Then, I tried warping my face to average face with factor of -1, which effectively warps my face to itself forming an exaggerated caricature:

Bells and whistles: Morphing between many images with DLIB face detector

For this part, I used the DLIB pre-trained face detector to identify keypoints of several images of myself and did a morph GIF between all of these images. The main point of this bell and whistle is to show the importance of keypoints. When DLIB misses a keypoint, or it has bad keypoint matching, there is a clear issue in the result. However, automated face detection is very fast and pretty reliable in that it's consistent ordering etc. which makes it useful for creating complex morphs quickly.