Project 3: Face Morphing

Richard Liu, 3033944112

Defining Correspondences

For this portion of the project, I will be morphing my face in my friend's.

First, we use the cpselect library to select points for between our two faces. Then we average the two point sets and compute a triangulation through the Delaunay method to minimize skinny and deformed triangles.

Here is the Delaunay triangulation plotted with the midway face.

Computing the "Mid-way Face"

Here is my face warped to the midpoint shape (average my me and John John's point sets).Next, we will begin the warping!

And here is John John's face warped to the midpoint shape.

The Morph Sequence

To complete our morph function, we split our calculation into three parts. First we use warp_frac to compute the intermediate shape configuration morph_pts = (1 - warp_frac) * im1_pts + warp_frac * im2_pts. Then, we apply our warp on both images using the same function we used to calculate the "mid-way face" earlier, but with morph_pts rather than the average shape. Finally, we cross-dissolve our two images as descripted in class, with (1 - dissolve_frac) * im1_warped + dissolve_frac * im2_warped.

Here is the mid-way face computed in the middle of cross-dissolving and warping (with warp_frac = dissolve_frac = 0.5).

With that done, all that's necessary is to apply our morph across the chosen number of frames, which is $45$ for my case. As each point, I will call morph on the two images, incrementing warp_frac and dissolve_frac by $\frac{1}{45}$ every frame.

GIPHY link broke :(

Here is the completed transition in boomerang format for smoother looping.

GIPHY link broke :(

The "Mean face" of a population

Using the Dane faces dataset, I computed the mean face shape of the entire population by parsing through all the .asf files and averaging the x- and y- locations of each point.

After calculating the mean face shape, we warp all faces in our dataset to this "mean shape". Here are some of the example warps.

And here, we average the pixels across all these warps to get the "average Dane".

Now, I can warp myself into the average geometry of the Dane face, and vice versa.

Caricatures: Extrapolating from the mean

We can create a caricature of ourselves by extrapolating certain deviations from the Danish population mean. For instance, we can take the difference between average male and female faces to get a gender deviation shape and color.

Now, to see what I would look like as a Danish woman, I can adjust an $\alpha$ hyperparameter and then multiply $\alpha$ by the shape difference and add it to my face shape. Finally, I can warp my face into that combined shape to finish the extrapolation.

Bells & Whistles

For bells and whistles, a group of students and I formed a video where we morphed into each others' faces. We each computed the morph from our face to the next.

Video link!

Here is frame from the video right in between me warping into Sam.