CS 194-26 Project 3: Face Morphing

lol

Defining correspondences

For the first segment, instead of using my face, we warp the Youtubers Scott Wozniak and Doug Walker into each other. To select their facial keypoints, we used a very manual and tedious process where I selected keypoints in GIMP in a mask layer and had code read it back in. However, I initially did not order the points from the GIMP readin, so a Jupyter notebook was written to match the points to each other one by one. It was incredibly painful.
The facial keypoints and triangulation mesh used.

For later parts, I engineered a solution where a floodfill algorithm would read a path to order the correspondences. This allowed correspondences to be generated much faster for later parts. The points would be ordered in the order of the algorithm encounteirng them in a breadth-first search

Pathing keypoints with a drawn line.

The midway face

We then compute the transformation between Scott's and Doug's points to their average keypoint location, and then transform the pixels to them. We get the following:
Scott Wozniak Doug Walker Their cursed midway face.

Morph sequence

We just linearly interpolate the weightings of both the color and morphed keypoint position here. Nothing too special.
The morph image.

The average shape of a population

Here, we just used the Danes dataset with the neutral expressioned males.

The mean face

The average Danish male researcher, from this dataset at least.

Various researchers morphed to the mean face

Click the buttons above to cycle through all of our results.

The general trend is that the images that warp better are the ones with faces that are closest to the "average" forehead, as the keypoints given in this dataset mostly deal with the eyes, eyebrows, nose, mouth, and jawline. (forehead shape isn't really included in the set)

Morphing Mike Matei into the mean face

As Wozniak and Walker both have glasses, but the mean Danish researcher face doesn't, I opted instead to work with Mike Matei, in his appearance from the renowned video short Minecraft with Gadget.
Mike Matei, about to introduce his friend Inspector Gadget.
Mike Matei warped to the average. The average warped to Mike Matei.

Admittedly, I may have placed Matei's keypoints (as they correspond to the mean keypoints of the Danes datast) a bit far around his eyes. I chose to leave it as is, as it makes the cariacture effect more pronounced. And it's kind of funny.

Cariactures from the Danish mean

We take the difference between Matei's keypoints and the mean Dane image's keypoints, and add this difference back at a factor of 0.7.

Here's a cariacture of Mike under the Danish researcher set.

The result is much smaller eyes (due to the previously discussed quirk of my labelling), and a jawline more aligned with the Danish researchers. Additionally, while Matei is slightly smiling, the Danish researchers are using a neutral facial expression in this subset, so Matei's expression has been shifted.

Bells and Whistles: Plead-o-tron 9000 🥺 🥺 🥺 🥺 🥺 🥺 🥺 🥺

After the quirk of Matei's eyes in the previous subsection, I wondered if manipulating face shape could be done intentionally with artificially created target keypoints. I decided, as an experiment, I would try and warp Matei and Walker's faces to a particular set of keypoints that tried to achieve a certain expression.

I'm not sorry.

The target keypoints. Mike's keypoints. Doug's keypoints.

You made it to the end! yay!

(buttons sourced from https://cyber.dabamos.de/88x31/)