Reading

  1. Mixing movement and machine by Maya Man.

    -Using technology, PoseNet, as a means to convey storytelling and meaning

  2. Humans of AI by Philipp Schmitt.

    -COCO: Common Objects in Context

    -Dataset with 328000 annotated images containing “91 object types that would be easily recognizable by a 4 year old.”

    -Images scraped from Flickr

    -Avoided images of single objects in isolation, wanted context

    -AI is not “magical”… COCO restores context to images, crediting the photographers and workers behind AI systems

  3. Open Sourcing the Origin Stories: The ml5.js Model and Data Provenance Project by Ellen Nickles

Making

For this week’s assignment, I was inspired by the filters that rearrange your face(ex. nose for eyes, eyes for nose). I decided to make a filter that replaces your eyes with your mouth and your mouth with your eye.

I started out trying BodyPose before realizing that it was pretty limited, with only 5 facial keypoints. BlazePose, on the other hand, has 11 facial keypoints.

Screenshot 2024-09-25 at 6.40.13 PM.png

Screenshot 2024-09-25 at 6.40.25 PM.png

I first had to detect the positions of the eyes and mouth. With BlazePose, I was impressed by the precision(3 keypoints for eyes and 2 for mouth).

I then did some research to find the copy() function, which can copy rectangular regions of an image/video and draw them in specified positions.

Screenshot 2024-09-25 at 4.53.53 PM.png

// mouth to left eye
    copy(video, leftMouth.x, leftMouth.y-mouthHeight*mouthScale/3, mouthWidth, mouthHeight, leftEyeInner.x - mouthWidth/2, leftEyeInner.y-mouthHeight*mouthScale/2, mouthWidth*mouthScale, mouthHeight*mouthScale)
    
    // mouth to right eye
    copy(video, leftMouth.x, leftMouth.y-mouthHeight*mouthScale/3, mouthWidth, mouthHeight, rightEyeOuter.x - mouthWidth/2, rightEyeInner.y-mouthHeight*mouthScale/2, mouthWidth*mouthScale, mouthHeight*mouthScale)
    
    // right eye to mouth    
    copy(video, rightEyeInner.x-rightEyeWidth, rightEyeInner.y-rightEyeHeight*scale/4, rightEyeWidth, rightEyeHeight, rightMouth.x, leftMouth.y-rightEyeHeight*scale/2, rightEyeWidth*scale, rightEyeHeight*scale)
    
    

The most difficult part was figuring out the positioning and doing all the math. The copied areas move with your face.

Screenshot 2024-09-25 at 5.29.03 PM.png

Mouth for eyes

Screenshot 2024-09-25 at 5.44.24 PM.png

Eye for mouth

Screenshot 2024-09-25 at 7.15.01 PM.png

I also added a slider(scale 1 to 3) to adjust the size of the mouth.

Link to Code

Since copy() can only take rectangular sections, I’d want to next work on isolate the shapes of my mouth/eyes more, sort of what BodySegmentation can do but I’m not sure it’d be precise enough? Overall I had fun experimenting this week. It’s cool too see how precise the keypoints are, especially with BlazePose.