faceswap_deepfake ubuntu-教程

Linux、ubuntu教程github_deepfake

环境
从faceswap环境下载faceswap_setup_x64.sh

 bash ./faceswap_setup_x64.sh

然后按照提示操作即可。中途有报错问题不大,运行时,缺啥安啥。

步骤

  1. 提取视频中的人脸做成训练用的图片-直接收集图片又慢效果又差
  2. 训练模型
  3. 转化视频

1、提取训练用的图片

# To extract trump from photos in a folder:
python faceswap.py extract -i ~/faceswap/src/trump -o ~/faceswap/faces/trump
# To extract trump from a video file:
python faceswap.py extract -i ~/faceswap/src/trump.mp4 -o ~/faceswap/faces/trump
# To extract cage from photos in a folder:
python faceswap.py extract -i ~/faceswap/src/cage -o ~/faceswap/faces/cage
# To extract cage from a video file:
python faceswap.py extract -i ~/faceswap/src/cage.mp4 -o ~/faceswap/faces/cage
# i = input o = output

2、训练模型

python faceswap.py train -A ~/faceswap/faces/trump -B ~/faceswap/faces/cage -m ~/faceswap/trump_cage_model/
# or -p to show a preview
python faceswap.py train -A ~/faceswap/faces/trump -B ~/faceswap/faces/cage -m ~/faceswap/trump_cage_model/ -p 

3、转化视频

python faceswap.py convert -i ~/faceswap/src/trump/ -o ~/faceswap/converted/ -m ~/faceswap/trump_cage_model/

你可能感兴趣的:(faceswap)