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

КОМЕНТАРІ • 16

  • @MattsRamblings
    @MattsRamblings  2 роки тому +2

    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.

  • @granite_planet
    @granite_planet 2 роки тому +16

    ShallowFake™️

    • @granite_planet
      @granite_planet 2 роки тому +7

      Meh, looks like they're already using the word for something else. I thought I was clever 😅

  • @inkilling3467
    @inkilling3467 9 місяців тому +2

    Brilliant!

  • @GammaRain
    @GammaRain 4 місяці тому

    you don't deserves a coffee, you deserves a hole building with a cafeteria inside.

  • @CatzHoek
    @CatzHoek 2 роки тому +4

    Wow the results are good

  • @iyadahmed3773
    @iyadahmed3773 2 роки тому +4

    Thanks a ton, this has great info

  • @redbird_studios
    @redbird_studios 2 роки тому +4

    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.

    • @MattsRamblings
      @MattsRamblings  2 роки тому +2

      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).

  • @plusplusplus9837
    @plusplusplus9837 2 роки тому +4

    great vid. did you pick the blurs manually in the example swaps?

    • @MattsRamblings
      @MattsRamblings  2 роки тому

      Thanks! I blurred the same amount (proportional to the face scale) for all of the pics in the outro.

  • @setoman1
    @setoman1 Рік тому +1

    I mean, you explained it in 20 seconds: By leveraging some heavy-weight libraries.

  • @goob8945
    @goob8945 2 роки тому +2

    Nice stuff. What the music in the background ?

    • @MattsRamblings
      @MattsRamblings  2 роки тому +1

      Thank you. Here's the background music: ua-cam.com/video/qGOwiziPwf4/v-deo.html

    • @goob8945
      @goob8945 2 роки тому

      @@MattsRamblings thanks so much 🙏🏽

  • @uis246
    @uis246 Рік тому +1

    *with 9M lines of C code