This project focused on morphing images of faces into one another and taking advantages of various weighted averages to produce morph sequences
To begin, I resized corresponding pairs of images to the same size (for consistency in keypoint labelling). Then, I used a tool called LabelBox to label the keypoints on my images and export them in a usable JSON format. Finally, I used scipy.spatial.Delaunay to find Delaunay triangulations on keypoints in images.
I used the procedure in the spec to compute the midway face for two pairs of images: me to Tony Stark and Yoda to baby Yoda. I first find a triangulation of the average of the keypoints, then use that traingulation to create a series of affine inverse warps from the target mid-way image to each source image. I then average the colors taken from both source images for each targe pixel (but with vectorized code). Unfortunately the pictures I used aren't perfect, so you'll notice the blending of Iron Man's armor with my shirt and baby Yoda's robes with Yoda's neck is not particularly smooth, but the result is still mostly visually smooth.
I used largely the same procedure as above to generate my full morph sequence. I just altered the values of warp_frac and dissolve_frac to step from 0 to 1, then saved the sequence of resulting images as a gif. For clarity, I added copies of the still frame at each target image, and ping-ponged the sequence so it can be played continuously in a loop.
This was too large to upload, so please find it at this Google Drive link, I couldn't figure out how to embed it but it looks (in my opinion) better than the other morph. Plus baby Yoda is really cute.
I used the Danish dataset linked in the spec. I computed the mean shape and face for all males in the dataset. I averaged the 58 keypoints for all the scientists (54 from the original dataset + 4 corners I added) to compute the average shape of the male Danish faces. I then morphed each face to this average geometry using the morph function I wrote before. Next, I element-wise averaged these morphed images to get the face of the average male Danish scientist. After that, I cropped and resized the average image so I could label keypoints on it. Then I used the same morph function as above to warp the Danish male to my geometry (by setting warp_frac to 0 and dissolve_frac to 1) and vice versa. Finally, I computed a caricature of myself as the average Danish male. Since the original image of me warped to the Danish male's geometry already looked pretty bad, I also computed a "softer caricature" in which I did cross disolve the image of my face and the average Danish face to get a slightly less ridiculous looking result.
I chose to change my perceived ethnicity. I found average images of Chinese and Tibetan males online, then used them to warp my face's shape, appearance, and both.