Face Swapping with Python & OpenCV

February 11, 2017

IMG_3517

We just had ArT=Mixx Metamorphisis here at the Maui Arts & Cultural Center on 2/4/2017. The ArT=Mixx is a free event where artist and audience meet and engage. We had Djs, art installations, dancers, and other performers. Attendees were encouraged to come in costume, mingle, and connect to the arts.

 

The evening’s ‘Metamorphosis’ theme is derived from the new exhibit that features a custom-designed installation for the gallery space by the artist that includes a large cocoon-like tubular structure made with yards of handwoven natural dyed silk and bamboo.

 

In keeping with the ‘Metamorphosis’ theme, I made a magic mirror that would swap faces of those walking by.

 

animated

 

The reactions were great. Most people loved it and took video with their phones.
A few people were so shocked that they didn’t want to try it.

 

 

Hardware:

  • 1x 60′ Visio HDTV
  • 1x 2015 Macbook Pro
  • 1x Logitech C920 HD Pro Webcam

 

Software:

The software was adapted from a repo by Marek Kowalski. Here is the original repo. I can’t thank him enough for making it open source. It’s really the best example out there. It uses the following:

  • Python 2.7
  • OpenCV
  • Numpy
  • dlib
  • pygame
  • PyOpenGL

 

Source:

https://github.com/ben-ward/FaceSwap

IMG_3519

IMG_3517

IMG_3502

Additional resources:

Original inspiration from Kyle Mcdonald. Really impressed with everything he does. http://kylemcdonald.net/

 

 

About the author:

Full-Stack Developer / Ruby On Rails / React.Js / Maker
Top