CS180 Project 3 -- Ryan Nader

github: https://github.com/berkeleybear22ryan/CS180_Project3

website: https://berkeleybear22ryan.github.io/CS180_Project3/

youtube links ...

1by2 with music: https://youtu.be/7lLSLp_FY-E

2by3 no music: https://youtu.be/YMR4u9ATedI

single sample: https://youtube.com/shorts/_67T6Cf6VCE

ALSO: may need to convert file extension name in order to run i.e. .jpeg to .jpg (as I worked with .jpg) for instance due to my compression on photos.

For "my" photo in the first section, I will be using Paris Hilton's photo and will transitioning it to Tavi Gevinson's photo then continue from there.

For "my" photo in the second section, I will be using image 40 from the sample data.

I attached them both below.

Image 1 Image 2

Also note that all the images are high resolution but because of web limitations I had to compress a lot but even though the video's were greater then 4k you can at least see it in 4k in you go to youtube links.

This is the citation for the data that I used for Martin Schoeller.

WEBSITE: https://martinschoeller.com/

This is the citation for the data that I used for IMM Face.

Also for more info on the dataset please refer to the pdf in folder imm_face_db.

Citation

M. B. Stegmann, B. K. Ersbøll, and R. Larsen. FAME - a flexible appearance modelling environment. IEEE Transactions on Medical Imaging, 22(10):1319-1331, 2003

            @ARTICLE{Stegmann2003tmi,
                author = "M. B. Stegmann and B. K. Ersboll and R. Larsen",
                title = "{FAME} -- A Flexible Appearance Modelling Environment",
                year = "2003",
                pages = "1319-1331",
                journal = "IEEE Trans. on Medical Imaging",
                volume = "22",
                number = "10",
                publisher = "IEEE"
            }
        

The code for this is in `a_start1.py` and `a_start2.py`.

Also these are my preprocessing steps that I used ...

I first found the images as follows ... and then I cleaned them by removing the backround and aligning the faces to be close to the same size and area.

Marina Abramovic

Marina Abramovic

Amy Adams

Amy Adams

Adele

Adele

Alexandria Ocasio-Cortez

Alexandria Ocasio-Cortez

Alyssa Ratkewitch Haughwout

Alyssa Ratkewitch Haughwout

Andre Agassi

Andre Agassi

Anne Hathaway

Anne Hathaway

Alan Arkin

Alan Arkin

Armani

Armani

Christian Bale

Christian Bale

Batsheva Dagan

Batsheva Dagan

Bekwynhy Kayapo

Bekwynhy Kayapo

Harry Belafonte

Harry Belafonte

Bono

Bono

Kobe Bryant

Kobe Bryant

Warren Buffet

Warren Buffet

David Chang

David Chang

Jessica Chastain

Jessica Chastain

Christopher Walken

Christopher Walken

George Clooney

George Clooney

Clint Eastwood

Clint Eastwood

Hillary Clinton

Hillary Clinton

Bradley Cooper

Bradley Cooper

Imani Cornelius

Imani Cornelius

Russell Crowe

Russell Crowe

Stephen Curry

Stephen Curry

Larry David

Larry David

Robert De Niro

Robert De Niro

Gabby Douglas

Gabby Douglas

Drake

Drake

Kirk Bloodsworth

Kirk Bloodsworth

Damon Thibodeaux

Damon Thibodeaux

Juan Melendez

Juan Melendez

Roger Federer

Roger Federer

James Franco

James Franco

Bill Gates

Bill Gates

Tavi Gevinson

Tavi Gevinson

Harald Gloockler

Harald Gloockler

Paris Hilton

Paris Hilton

Jack Nicholson

Jack Nicholson

LeBron James

LeBron James

Jay-Z

Jay-Z

Marika Johansson

Marika Johansson

Elton John

Elton John

Dwayne Johnson

Dwayne Johnson

Michael Jordan

Michael Jordan

Joseph Homeless

Joseph Homeless

Judi Dench

Judi Dench

Julia

Julia

Colin Kaepernick

Colin Kaepernick

Karlie Kloss

Karlie Kloss

Debi Laszewski

Debi Laszewski

Lil Wayne

Lil Wayne

Joachim Low

Joachim Low

Peter Maffay

Peter Maffay

Matthew McConaughey

Matthew McConaughey

Conor McGregor

Conor McGregor

Lione Messi

Lione Messi

Gayle Moher

Gayle Moher

Janelle Monae

Janelle Monae

Bill Murray

Bill Murray

Lenda Murray

Lenda Murray

Elon Musk

Elon Musk

Nadia Nardi

Nadia Nardi

Barack Obama

Barack Obama

Katy Perry

Katy Perry

Pink

Pink

Natalie Portman

Natalie Portman

Prada

Prada

Questlove

Questlove

Rabbi Schmuley

Rabbi Schmuley

Rihanna

Rihanna

Eric Schmidt

Eric Schmidt

Ivory Sears

Ivory Sears

Harpreet Singh Sikh

Harpreet Singh Sikh

Meryl Streep

Meryl Streep

Taylor Swift

Taylor Swift

Jeffery Tambor

Jeffery Tambor

Justin Timberlake

Justin Timberlake

Mike Tyson

Mike Tyson

Valentino

Valentino

Donatella Versace

Donatella Versace

Denzel Washington

Denzel Washington

Emma Watson

Emma Watson

Mark Webber

Mark Webber

Kanye West

Kanye West

Betty White

Betty White

Shaun White

Shaun White

Serena Williams

Serena Williams

Oprah Winfrey

Oprah Winfrey

Santiago Winter

Santiago Winter

Yona Amit

Yona Amit

Zidane

Zidane

Zuckerberg

Zuckerberg

Christy Turlington

Christy Turlington

In this I implemented both a way to manually select the points by hand in a_start1.py as well as automating the process.

As the instructions mentioned that it would be better to have more points and I wanted to create a longer morph I decided to use the automated way as I got good results when testing.

Also another important note is that the automated way also enabled the point mapping to have a consistency to it that I think helped the results a lot.

I computed all the points and saved them in `./code/points` and there are 558 points per images and 94 total images.

After I used delaunay triangulation as recommended.

Here is an example of what it looked like:

The code for this is in `a_start3.py`.

Here is an `A` and `B` image and a `midway faces` that I got ...

The code for this is in `a_start3.py`.

The video results can be found here ...

youtube links ...

1by2 with music: https://youtu.be/7lLSLp_FY-E

2by3 no music: https://youtu.be/YMR4u9ATedI

single sample: https://youtube.com/shorts/_67T6Cf6VCE

The code for this part is in `a_start4.py`.

for this section I picked the immface dataset with the following population ...

now from this we were given the face labels ...

then from here we computed the average face shape of the whole population

the final result is ...

now we then morphed each of the faces in the dataset into the average shape ...

then we compute the average face of the population ... which is ...

Show the mean image that you got (I described what image I used as me in the overview), as well as ...

(1) your face warped into the average geometry

(2) the average face warped into your geometry

The code for this part is in `a_start5.py`.

Facial Feature Path Mapping and Example ASF File

Facial Feature Path Mapping

Based on the point paths and observations, we can infer the following mapping between the path numbers and facial features:

This mapping aligns with the 7 point paths mentioned in the description (3 closed paths and 4 open paths). The closed paths are likely the mouth and eyes, while the open paths are the eyebrows, nose, and jawline.

Now the theory for this part is: $S_{\text {caricature }}=S_{\text {mean }}+\alpha \cdot\left(S_{\text {mase }}-S_{\text {mean }}\right)$

When $\alpha>1$ : Exaggerates your features (caricature).

When $0<\alpha<1$ : Makes your features closer to the mean.

When $\alpha<0$ : Inverts your features relative to the mean.

When $\alpha=0$, then $S_{\text {caricature }}=S_{\text {mean }}+0 \cdot\left(S_{\text {user }}-S_{\text {mean }}\right)=S_{\text {mean }}$ i.e. it because the mean which we can see mathematically.

...

$\alpha<0$ : Inverts your features relative to the mean.

$\alpha=0$ : Your face is morphed to the mean face shape.

$0<\alpha<1$ : Your face moves closer to the mean face shape, reducing your unique features.

$\alpha=1$ : The caricature shape is your original face shape $\left(S_{\text {caricature }}=S_{\text {user }}\right)$.

$\alpha>1$ : Exaggerates the differences between your face and the mean, creating a caricature.

here are the results using this technique ...

so we know that the mean and user results that we got earlier were ...

Image 1 Image 1 Image 1 Image 1

now we just apply the formula to create the caricature and we get the following ...

from this you can see that $\alpha>1$ creates ...

Image 1 Image 1

I had to do one mandtory BW ... here are some things that I did.

Create a system that could layout points witha accuracy and consistency on faces

Did this process on very high resolution photos.

Created a theme video centered around Martin Schoeller.

Made a video with music and showed the triangulation movement in a visual.

Came up with the idea to use what we learned about last time with sharpening to help keep the eyes sharp during the morph, something that really is important in Martin Schoeller images.

Manually created the order of the photo to have a nice flow and style

Lined up all the photos close enough by hand and cropped one that had the entire body.

Remove the backround of all the photos as well using the masking technique.

Also a cool extension of this would be to find the average face and basically do part 2 with this as my tool can place points so would have cool result, but I ran out of time.

NOTE: links for video are at the top of the page and also below.

The video results can be found here ...

youtube links ...

1by2 with music: https://youtu.be/7lLSLp_FY-E

2by3 no music: https://youtu.be/YMR4u9ATedI

single sample: https://youtube.com/shorts/_67T6Cf6VCE