yuval-alaluf / SAM

Official Implementation for "Only a Matter of Style: Age Transformation Using a Style-Based Regression Model" (SIGGRAPH 2021) https://arxiv.org/abs/2102.02754
https://yuval-alaluf.github.io/SAM/
MIT License
632 stars 151 forks source link

inconsistent results #1

Closed ofirkris closed 3 years ago

ofirkris commented 3 years ago

Hi Yuval, Thanks for sharing this cool implementation I've played with it, and noticed i'm getting bad results when inputing non-square non-cropped face images see example below.

When compared your project to "stylegan2 distillation" I notice they deal with it better Any idea how I can improve this to deal with real world images better?

Reference image below:

margi-test

ofirkris commented 3 years ago

Even with a square image input with cropped face - when it's not looking straight towards the camera you will notice the face gets wider in the results test (2)

yuval-alaluf commented 3 years ago

When performing inference, you need to make sure to first align the input image as was done during training.
I realized that I forgot to add an alignment step to the inference notebook so I will try to add that soon and hopefully that will help fixed the problem.

yuval-alaluf commented 3 years ago

I uploaded an updated notebook with an alignment step, see commit: https://github.com/yuval-alaluf/SAM/commit/3dad5a758c004016c3a0dfb6f927e57f40b4cffa. Note that for the animation inference notebook, we assume that the images are pre-aligned. However, we provide an alignment script in case your images are not pre-aligned.