matthewearl / faceswap

Python script to put facial features from one face onto another
MIT License
1.4k stars 496 forks source link

correct_colours acts strangely in mouth area #10

Open dribnet opened 8 years ago

dribnet commented 8 years ago

I've noticed that the correct_colours routine is misbehaving in the mouth area. Here's an example with Kanye West’s body and a replacement face image:

input_sized transformed

You will get this output, where the lips appear white:

out1

This shows just the transformed output by setting the output of get_face_mask() to all white:

out3

And here is what the faceswap looks like if the correct_color step is skipped:

out5


Here is a second example with Gwyneth Paltrow's body and a replacement face.

input_image transformed

The colour correction this time causes a crazy bloody mouth look:

final_image

Turning off colour correction fixes this:

out2


I might look into this more and be able to offer a pull request to tweak the correct_colours() routine to fix this, but wanted to go ahead and report the issue.

puppet101 commented 8 years ago

Hi, @dribnet,

I face the same problem with you, have you work out any solution for this? Thank you!

dribnet commented 8 years ago

I have not - my only solution so far has been to simply turn off color correction - but I would be still be interested if anyone had time to propose better color correction routine. One thought could be to make a new mask for the color routine to limit it to the boundary region between the two images.

wadewj521 commented 6 years ago

@dribnet hi Have you done pre-process with face picture? How do I make the skin tone and brightness of head picture and face picture similar?