Giter VIP home page Giter VIP logo

faceoff's Introduction

Faceoff

Img2Image - Img2GIF - Img2MP4

Swap faces from a source image to a destination medium. Each app runs independelty in it's own Gradio instance for ease of use.

Read more at https://thebiglaskowski.com/posts/face-swapping-with-ai

Demo: Faceoff Img2MP4 vs DeepFaceLab Deepfake

Faceoff on the left, DeepFaceLab on the right

Faceoff.Img2MP4.VS.DeepFaceLab.Comparison.mp4

Installation

Dependencies

  1. FFmpeg

Download and install FFmpeg

  1. CUDA >= 10.1

Download and install CUDA

  1. Requirements
git clone https://github.com/thebiglaskowski/faceoff.git
cd faceoff
conda create -n faceoff python=3.8 -y
conda activate faceoff
pip install torch==1.11.0+cu115 torchvision==0.12.0+cu115 -f https://download.pytorch.org/whl/torch_stable.html

# If not using CodeFormer enhancement use this torch & torchvision version instead

pip install torch==2.0.0+cu118 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.15.1+cu118 -f https://download.pytorch.org/whl/torch_stable.html

pip install -r requirements.txt
  1. Download the inswapper_128.onnx model from Hugging Face and place it in the root directory of this project.

Usage

Faceoff Img2Img

python faceoff.py

http://127.0.0.1:5000/

Faceoff Img2GIF

python faceoff_gif.py 

http://127.0.0.1:5001/

Faceoff Img2MP4

python faceoff_video.py

http://127.0.0.1:5002/

Demo: Faceoff Img2MP4 - Basic vs Enhanced (w/CodeFormer)

Basic on the left, Enhanced on the right

Faceoff.Img2MP4.Basic.vs.Enhanced.Comparison.mp4

Sarah Connor?

Watch the video

To Do

  • Add Enhanced version of Img2GIF
  • Add Enhanced version of Img2MP4
  • Develop controls to manage multiple faces (source/destination)

Special Thanks To

faceoff's People

Contributors

thebiglaskowski avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

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.