在Colab上运行DeepfaceLab训练模型

md.render(‘H~2~0’)

环境

  1. Colab:https://colab.research.google.com/

利用开源的DeepFaceLab_Colab

地址DeepFaceLab_Colab

注意事项

  1. colab上面使用的是linux平台,linux平台拥有更好的合成效果
  2. 如果挂载的云盘上面已经安装了deepface的时候,可以修改初始化代码,如下:

一键训练

! /opt/bin/nvidia-smi
from google.colab import drive
drive.mount('/content/drive')
import os 
root = "/content/drive/MyDrive/" #@param {type:"string"}

%cd $root
deepfacelab=os.path.join(root,"DeepFaceLab")
workspace=os.path.join(deepfacelab,"workspace")
deepfacelab_cloab=os.path.join(deepfacelab,"DeepFaceLab_Colab")

#@title 训练模型
Model = "SAEHD" #@param ["SAEHD","AMP","Quick96","XSeg"]
%cd $deepfacelab_cloab
!pip install -r requirements-colab.txt  
cmd = "main.py train --training-data-src-dir ../workspace/data_src/aligned --training-data-dst-dir ../workspace/data_dst/aligned --model-dir ../workspace/model --model "+Model+" --no-preview"
!python $cmd
  1. src素材库一定需要各种角度,光线的高清素材,此时训练效果最好

效果展示

版权声明: 本文首发于指尖魔法屋-在Colab上运行DeepfaceLab训练模型,转载或引用必须申明原指尖魔法屋来源及源地址!