Giter Site home page Giter Site logo

face-swap's Introduction

face-swap

换脸程序

以本地程序直接运行

准备

由于后面需要安装 python dlib 包,所以需要先确定 CMake 已经安装:

Ubuntu

sudo apt update
sudo apt install cmake

Mac OSX

brew install cmake
brew install python-tk

安装

git clone https://github.com/JeffTrain/face-swap
cd face-swap
pip install -r requirements.txt

使用

python face_swap.py ted_cruz.jpg donald_trump.jpg

测试

sh test.sh

效果

以上示例命令会把特德·克鲁斯的脸部换到唐纳德·特朗普的照片上。

源照片 目标照片 结果照片
特德·克鲁斯 唐纳德·特朗普 结果照片
65680534-b7c82780-e089-11e9-8079-f926cbe05eff 唐纳德·特朗普 结果照片

测试矩阵

环境 Python 版本 结果
Windows 2.7 通过
Windows WSL 2.7 通过
Mac OSX 3.9.12 通过

以线上服务形式运行

线上服务(提交代码后自动部署)

restful
GraphQL

本地运行服务

. venv/bin/activate

pip install -r requirements.txt
python -m flask --app hello run --host 0.0.0.0 --port 5001
open http://localhost:5000/apidocs
open http://localhost:5001/graphql

docker 方式运行

docker build --tag face-swap:test .
docker run -d -p 5001:5000 face-swap:test
open http://localhost:5001/apidocs/
open http://localhost:5001/graphql

Star History

https://api.star-history.com/svg?repos=jefftrain/face-swap&type=Date

face-swap's People

Contributors

jeff-tian avatar buzzbuzzenglish avatar dependabot[bot] 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.