CS194-26 Project 3: Face Morphing

Ellin Zhao

0 Image correspondences

In [13]:
%matplotlib inline

plt.figure(figsize=(20,10))

plt.subplot(131)
plt.imshow(plt.imread('./data/annotated.png'))
plt.title('Ordering of points')
plt.axis('off')

plt.subplot(132)
plt.imshow(im1)
plt.triplot(p1[:,0], p1[:,1], tri.simplices.copy(), color='r')
plt.plot(p1[:,0], p1[:,1], 'or')
plt.title('Timothee Chalamet')
plt.axis('off')

plt.subplot(133)
plt.imshow(im2)
plt.triplot(p2[:,0], p2[:,1], tri.simplices.copy(), color='r')
plt.plot(p2[:,0], p2[:,1], 'or')
plt.title('Taskeshi Kaneshiro')
plt.axis('off');

1 Mean image

In [17]:
plt.figure(figsize=(20,10))

plt.subplot(131)
plt.imshow(im1)
plt.axis('off')
plt.title('Timothee')

plt.subplot(132)
plt.imshow(morph)
plt.axis('off')
plt.title('Midway face')

plt.subplot(133)
plt.imshow(im2)
plt.axis('off')
plt.title('Takeshi');

2  Morph sequence

SegmentLocal

3 "Mean face" of population

Below, I am using the Brazilian face dataset from https://fei.edu.br/~cet/facedatabase.html.

In [21]:
plt.figure(figsize=(20,10))

plt.subplot(121)
plt.title('Single face morphed to average shape')
plt.imshow(singleface)
plt.axis('off');

plt.subplot(122)
plt.title('Mean face of FEI dataset')
plt.imshow(meanface)
plt.axis('off');

4  Caricature

In [24]:
%matplotlib inline

plt.figure(figsize=(20,10))

plt.subplot(121)
plt.title('My face')
plt.imshow(me)
plt.axis('off');

plt.subplot(122)
plt.imshow(me)
plt.triplot(pe[:,0], pe[:,1], tri.simplices.copy(), color='r')
plt.plot(pe[:,0], pe[:,1], 'or')
plt.title('My face with triangulation')
plt.axis('off');
In [26]:
plt.figure(figsize=(20,10))

plt.subplot(131)
plt.imshow(meanface)
plt.axis('off')
plt.title('Mean face')

plt.subplot(132)
plt.imshow(me_meanshape)
plt.axis('off')
plt.title('My face with the mean face shape')

plt.subplot(133)
plt.imshow(me)
plt.axis('off');
plt.title('My face');

Morphing my face to have the average face shape looks strange. I think this is attributed to my face and feature shapes being quite different from the average shape. For example, my nose is not perky and my brows are arched, unlike the average feature shape.

In [29]:
plt.figure(figsize=(20,10))

plt.subplot(131)
plt.imshow(meanface)
plt.axis('off')
plt.title('Mean face')

plt.subplot(132)
plt.imshow(meanface_my_shape)
plt.axis('off')
plt.title('Mean face with my face shape')

plt.subplot(133)
plt.imshow(me)
plt.axis('off')
plt.title('My face');

It is interesting that the eyes are bigger in the morphed face shape. This is because the eye transforms do not break up the eye into smaller portions so in order to make the eyes more upturned, it warps the entrie eye and makes it larger.

5 Bells and Whistles

For the required Bells and Whistles, I will morph my face with the "average" white male face.

In [40]:
%matplotlib inline
plt.figure(figsize=(20,10))

plt.subplot(131)
plt.imshow(male)
plt.axis('off')
plt.title('Average white male face')

plt.subplot(132)
plt.imshow(me_morph_male)
plt.axis('off')
plt.title('Me morphed to male face')

plt.subplot(133)
plt.imshow(me)
plt.axis('off')
plt.title('My face');

This morph was weirdly effective and I don't like it....