deepfacelab中文网

 找回密码
 立即注册(仅限QQ邮箱)
查看: 2313|回复: 7

训练liae万能模型的方法

[复制链接]

3

主题

93

帖子

1057

积分

初级丹圣

Rank: 8Rank: 8

积分
1057
 楼主| 发表于 2022-6-27 19:15:58 | 显示全部楼层 |阅读模式
星级打分
  • 1
  • 2
  • 3
  • 4
  • 5
平均分:NAN  参与人数:0  我的评分:未评
和滚石大大贴的那个训练DF模型的方法有什么不同之处?liae开不了true face power,那么DST文件夹里还应该使用杂七杂八的混合人脸吗?会不会把专模的特色减弱?附上滚石大大的那篇教学:https://dfldata.xyz/forum.php?mod=viewthread&tid=310
回复

使用道具 举报

3

主题

93

帖子

1057

积分

初级丹圣

Rank: 8Rank: 8

积分
1057
 楼主| 发表于 2022-6-27 21:37:39 | 显示全部楼层
我在mrDeepFakes上找到答案了。贴在这里。
注意:RTM其实就是咱们论坛常说的万能丹,ReadyToMerge字面意思是“直接合成”的模型,意思是不用训练。

10.3 RTM Training Workflow:

With introduction of DeepFaceLive (DFLive) a new training workflow has been established, contrary to what some users think this isn't a new training method and does not differ significantly from regular training and this training method has been employed by some people in one way or another, you may have yourself create one by accident without even realizing it.

RTM models (ReadyToMerge) are created by training an SRC set of the person we want to swap against large and varied DST set containing random faces of many people which covers all possible angles, expressions and lighting conditions. The SRC set must also have large variety of faces. The goal of RTM model training is to create a model that can apply our SRC face to any video, primarly for use with DeepFaceLive but also to speed up training process within DeepFaceLab 2.0 by creating a base model that can very quickly adapt to new target videos in less time compared to training a model from scratch.

The recommended type of models for use with RTM workklow are SAEHD LIAE models, LIAE-UD or LIAE-UDT thanks to their superior color and lighting matching capabilities as well as being able to adapt better to different face shapes than DF architecture.
AMP models can also be used to create RTM models, although they work a bit differently and as I lack know-how to explain AMP workflow yet I will only focus on LIAE RTM model training in this part of the guide.

1. Start by preparing SRC set: make sure you cover all possible angles, each with as many different lighting conditions and expressions, the better the coverage of different possible faces, the better results will be.

2. Prepare a DST set by collecting many random faces: this dataset must also have as much variety as possible, this dataset can be truly random, consisting of both masculine and femine faces of all sorts of skin colors or it can be specific to for example black masucline faces or feminine asian faces if that's the type of target face you plan on primarly use the model with, the more variety and more faces in the set the longer it will take to train a model.
ALTERNATIVELY - USE RTM WF dataset from iperov: https://tinyurl.com/2p9cvt25
If the link is dead go to https://github.com/iperov/DeepFaceLab and find torrent/magnet link to DFL builds as they contain the RTM WF dataset along them.

3. Apply XSeg masks to both datasets: this will ensure model correctly trains and as with any other training is require in order to create WF model and while it's optional for FF models it's still recommended to apply XSeg mask of the correct type to both datasets, make sure you use the same XSeg model for both datasets.

4. Pretrain a new model or use one that you already pretrained: pretrain for at least 600k-1kk iterations.

5. Start training on your SRC and random DST. If you are using an existing RTM model that you or someone else trained as your base model instead of pretrained model delete inter_ab file from the "model" folder before proceeding to train it:

NEW WORKFLOW:

Pretrain or download a WF LIAE-UDT SAEHD model (due to better SRC likenes -UDT variant can achieve, if you can't run LIAE-UDT model, pretrain or use an existing pretrained LIAE-UD model).

Resolution: 224 or higher. Face Type: WF.
Dims: AE: 512, E: 64, D: 64, D Masks: 32
Settings: EMP Enabled, Blur Out Mask Enabled, UY Enabled, LRD Enabled, BS:8 (if you can't run your model with high enough BS follow standard procedures to reduce model parameters: archi, dims, optimizer, optimizer/lrd on cpu).
Others options should be left at default values. Optionally use HSV at power 0.1 and CT mode that works best for you, usually RCT.

Make a backup before every stage or enable auto backups.

1. Train +2.000.000 iters with RW enabled and delete inter_AB.npy every 500k iters (save and stop model training, delete the file and resume training)
2. After deleting inter_AB 4th time train extra +500k with RW enabled.
3. If swapped face looks more like DST, delete inter_AB and repeat step 2.
4. Disable RW and train for additional +500k iters.
5. Enable GAN at power 0.1 with GAN_Dims:32 and Patch Size being 1/8th of your model resolution for +800.000k iters.

ALTERNATIVE EXPERIMENTAL WORKFLOW (NOT TESTED):

Follow the same steps as in the new workflow except do not train with EMP and LRD enabled all the time, instead near the end of step 2/3 run the model a bit with RW Enabled and LRD enabled until loss stops decreasing, then move on to step 4 by disabling both RW and LRD, after 400-500k run EMP for about 100-200k and then disable EMP and enable LRD for yet another 100-200k. UY can be left enabled all the time or disabled and enabled halfway through steps 2/3 and later halfway through step 4.
回复 支持 2 反对 0

使用道具 举报

3

主题

93

帖子

1057

积分

初级丹圣

Rank: 8Rank: 8

积分
1057
 楼主| 发表于 2022-6-27 21:52:58 | 显示全部楼层
whatsall 发表于 2022-6-27 21:37
我在mrDeepFakes上找到答案了。贴在这里。
注意:RTM其实就是咱们论坛常说的万能丹,ReadyToMerge字面意思 ...

大家有看不懂的可以问我,我在DFL方面是小白,但是因为在美国留过学,所以英文还可以。
回复 支持 反对

使用道具 举报

5

主题

99

帖子

1604

积分

初级丹圣

Rank: 8Rank: 8

积分
1604
发表于 2022-6-27 22:08:23 | 显示全部楼层
whatsall 发表于 2022-6-27 21:37
我在mrDeepFakes上找到答案了。贴在这里。
注意:RTM其实就是咱们论坛常说的万能丹,ReadyToMerge字面意思 ...

跟果子貍翻譯的哪篇差在哪
回复 支持 反对

使用道具 举报

2

主题

508

帖子

2690

积分

初级丹圣

Rank: 8Rank: 8

积分
2690
发表于 2022-6-27 22:48:15 | 显示全部楼层
whatsall 发表于 2022-6-27 21:37
我在mrDeepFakes上找到答案了。贴在这里。
注意:RTM其实就是咱们论坛常说的万能丹,ReadyToMerge字面意思 ...

又一個被作者騙的小白!
我們的老大也是這麽練的,結果呢?
回复 支持 反对

使用道具 举报

3

主题

434

帖子

2448

积分

初级丹圣

Rank: 8Rank: 8

积分
2448
发表于 2022-6-27 23:05:46 | 显示全部楼层
到底要怎么练呢?
回复 支持 反对

使用道具 举报

4

主题

254

帖子

1670

积分

初级丹圣

Rank: 8Rank: 8

积分
1670
发表于 2022-6-30 20:23:29 | 显示全部楼层
这问题的确需要一个教程。
回复 支持 反对

使用道具 举报

1

主题

46

帖子

668

积分

高级丹师

Rank: 5Rank: 5

积分
668
发表于 2023-2-3 23:46:31 | 显示全部楼层
10.3 RTM培训工作流程:



随着DeepFaceLive(DFLive)的引入,一个新的培训工作流程已经建立,与一些用户认为的不同,这不是一种新的培训方法,与常规培训没有明显区别,而且这种培训方法已经被一些人以某种方式使用,您可能会在没有意识到的情况下意外创建一个。



RTM模型(ReadyToMerge)是通过训练我们想要交换的人的SRC集合来创建的,该集合包含许多人的随机面孔,涵盖了所有可能的角度、表情和照明条件。SRC集合还必须具有多种面。RTM模型训练的目标是创建一个模型,该模型可以将我们的SRC脸应用于任何视频,主要用于DeepFaceLive,但也可以通过创建一个基础模型来加快DeepFaceLab 2.0中的训练过程,与从头开始训练模型相比,该基础模型可以在更短的时间内快速适应新的目标视频。



与RTM workklow一起使用的推荐型号是SAEHD LIAE型号、LIAE-UD或LIAE-UDT,因为它们具有卓越的颜色和照明匹配能力,并且能够比DF架构更好地适应不同的面部形状。

AMP模型也可以用于创建RTM模型,尽管它们的工作方式有点不同,而且由于我缺乏解释AMP工作流的专业知识,因此在本指南的这一部分中,我只关注LIAE RTM模型培训。



1.从准备SRC集合开始:确保覆盖所有可能的角度,每个角度都有尽可能多的不同照明条件和表情,不同可能的面部覆盖得越好,效果越好。



2.通过收集许多随机人脸来准备DST集:这个数据集也必须尽可能多的多样性,这个数据集可以是真正随机的,由各种肤色的男性和女性面孔组成,或者它可以是特定的,例如,黑色面具面孔或女性亚洲面孔,如果这是你计划主要使用的目标面孔类型,布景中的种类越多、面孔越多,训练模特需要的时间就越长。

备选方案-使用来自iperov的RTM WF数据集:https://tinyurl.com/2p9cvt25

如果链接已断开,请转到https://github.com/iperov/DeepFaceLab并找到与DFL构建的torrent/magnet链接,因为它们包含RTM WF数据集。



3.将XSeg掩码应用于两个数据集:这将确保模型正确训练,并且与创建WF模型所需的任何其他训练一样,虽然对于FF模型是可选的,但仍建议将正确类型的XSeg掩码用于两个数据集中,确保对两个数据组使用相同的XSeg模型。



4.预训练一个新模型或使用一个你已经预训练过的模型:预训练至少600k-1kk的迭代。



5.开始SRC和随机DST训练。如果您使用的是您或其他人训练为基础模型的现有RTM模型,而不是预训练模型,请在继续训练之前从“模型”文件夹中删除inter_ab文件:



新工作流:



预训练或下载WF LIAE-UDT SAEHD模型(由于更好的SRC相似性-UDT变体可以实现,如果无法运行LIAE-UDT模型,则预训练或使用现有预训练的LIAE-UD模型)。



分辨率:224或更高。面类型:WF。

尺寸:AE:512,E:64,D:64,D掩模:32

设置:EMP已启用、Blur Out Mask已启用、UY已启用、LRD已启用、BS:8(如果您无法在足够高的BS下运行模型,请遵循标准程序以减少模型参数:archi、dims、优化器、优化器/LRD on cpu)。

其他选项应保留为默认值。可以选择使用功率为0.1的HSV和最适合您的CT模式,通常是RCT。



在每个阶段之前进行备份或启用自动备份。



1.在启用RW的情况下训练2.000.000次迭代,并每500k次删除inter_AB.npy(保存并停止模型训练,删除文件并恢复训练)

2.删除inter_AB第四次列车额外500k后,启用RW。

3.如果交换的面看起来更像DST,请删除inter_AB并重复步骤2。

4.禁用RW并训练额外的500k迭代。

5.启用GAN,功率为0.1,GAN_Diam:32,补丁大小为800.000k迭代的模型分辨率的1/8。



备选实验工作流程(未测试):



遵循与新工作流程中相同的步骤,但不要一直在启用EMP和LRD的情况下进行训练,而是在接近第2/3步结束时,在启用RW和LRD时运行一点模型,直到损耗停止减少,然后继续执行第4步,在400-500k运行EMP约100-200k,然后禁用EMP并启用LRD再运行100-200k。UY可以一直保持启用状态,也可以在步骤2/3的中途禁用并启用,然后在步骤4的中途启用。
回复 支持 反对

使用道具 举报

QQ|Archiver|手机版|deepfacelab中文网 |网站地图

GMT+8, 2024-9-22 03:33 , Processed in 0.108531 second(s), 10 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表