Coder Social home page Coder Social logo

constannnnnt / video_faceswap Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 6.0 17 KB

Given a user profile, a video clip and an actor(actress) profile in the video, Swap the actor's face with the user's face

License: MIT License

Python 100.00%
face-recognition face-swap face-detection face-landmarks video-processing image-processing

video_faceswap's Introduction

Video FaceSwap

Given a video clip, a user profile and an actor(actress) profile in the video, Swap the actor's face with the user's face. In a word, just replace the face of an actor with the input image for fun.

Prerequisite

Install the prerequisites before using this module

  1. Install Cmake
  2. Install GCC(version>=4.8)
  3. Install ffmpeg
  4.  pip3.5 install -r requirements.txt

Note: You will also need the facial landmark detector. The trained model can be downloaded from the source. Then, you can place it in the same directory where main.py is placed.

Usage

python main.py $video_address $user_face_address $selected_actor_address $temp_address $output_video

E.g. python main.py ./data/videos/video.mp4 ./data/images/user.jpeg ./data/images/actor.jpeg ./output/ ./output/output.mp4

Issue

  1. To accelerate the program, multiprocessing is used, but it will comsume all your memory. If you are not interested in the computation time, you can comment this part out in faceswap.py and use sequential procedures.

    cores = multiprocessing.cpu_count()
    pool = multiprocessing.Pool(processes=cores)
    pool.map(faceswapper, actors)
    pool.close()
    pool.join()

Credits

Thanks to face_recognition by Adam Geitgey and faceswap by Matthew Earl.

video_faceswap's People

Contributors

constannnnnt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

video_faceswap's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.