faceswap php源码,faceswap

This is the code behind the Switching Eds blog post.

See the link for an explanation of the code.

To run the script you'll need to install dlib (http://dlib.net) including its

Python bindings, and OpenCV. You'll also need to obtain the trained model from

sourceforge.

Unzip with bunzip2 and change PREDICTOR_PATH to refer to this file. The

script is run like so:

./faceswap.py

If successful, a file output.jpg will be produced with the facial features

from

replaced with the facial features from .

安装使用说明

安装python 编译器,

python 版本 2.7.15

https://www.python.org

安装相关包

在根目录下,也就是在faceswap/下运行:

pip install -r requirements.txt

运行脚本

在根目录下,运行命令

python faceswap.py

例如:

python faceswap.py image/01.jpg image/016.jpg

生成照片,在根目录下位置:

output.jpg 为换脸后的效果。

需要说明的是:

该算法只能支持仅包含一张脸的照片,多张脸会报错,运行成功。

目录结构说明

faceswap

├── README.md ... 本文档

├── requirements.txt ... 所需的依赖包

├── faceswap.py ... 运行脚本

├── shape_predictor_68_face_landmarks.dat ... 人脸识别库

├── image/ ... 原照片所存目录

└── output.jpg ... 生成的换脸结果照片

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值