Swapping faces with 100,000 lines of C and 90 lines of Python
Вставка
- Опубліковано 1 чер 2024
- Back in 2015 I wrote a short Python script to swap faces from two images. In this video I explain how.
Outro image credits: Original images (left and right columns) by Gage Skidmore, licensed under CC-BY-SA 2.0. Modified images (middle column) are licensed CC-BY-SA 2.0. creativecommons.org/licenses/...
Bush and Obama images are public domain.
00:00 Introduction
00:20 Loading images
00:40 Landmarks
01:47 Image transformations
02:49 Masking
03:42 Colour correction
04:48 Outro and more results
There is a blog post version of this video that covers an older version of the code here:
matthewearl.github.io/2015/07/28/switching-eds-with-python/
Bear in mind that since then technology has moved on a lot, with techniques such as deepfakes which can convincingly handle motion and varying angles and facial poses.
ShallowFake™️
Meh, looks like they're already using the word for something else. I thought I was clever 😅
Brilliant!
you don't deserves a coffee, you deserves a hole building with a cafeteria inside.
Wow the results are good
Thanks a ton, this has great info
Very clear and informative. Have you tried applying this script to 2 videos instead of still images? I wonder what it looks like in motion.
I haven't tried this myself, but it sounds like an interest idea to try! One limitation of my method is that it doesn't account for different angles of the face (aside from rotations in the image plane) so for good results you'd need to make sure your source videos have faces pointing in the same direction (eg. both looking at the camera).
great vid. did you pick the blurs manually in the example swaps?
Thanks! I blurred the same amount (proportional to the face scale) for all of the pics in the outro.
I mean, you explained it in 20 seconds: By leveraging some heavy-weight libraries.
Nice stuff. What the music in the background ?
Thank you. Here's the background music: ua-cam.com/video/qGOwiziPwf4/v-deo.html
@@MattsRamblings thanks so much 🙏🏽
*with 9M lines of C code