MrDeepFakes Forums

Full Version: (unofficial) DFL 1.0 SAE+ MOD.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
With the new DeepFaceLab 2.0, this mod is now outdated and will only work for version 1.0 of DeepFaceLab

This is a modified SAE that adds features introduced to SAEHD but not to SAE.  This gives SAE nice features without the extra layers that makes SAEHD intensive, especially on older cards.

Thing added are to this modified SAE are:
  • Added lr_dropout toggle on/off (When the face is trained enough, you can enable this option to get extra sharpness for less amount of iterations)
  • Added TrueFace training with options (0 - Disabled, 1 - Low, 2 - Medium, 3 - High, 4 - Ultra ... higher = more aggressive)
  • Added new option called 'network' that can be switched between 'adam' and 'rmsprop' (See below for difference)
  • Added option to disabled random warp (can be disabled around 30K iterations, should increase sharpness with less iterations)
  • Pixel loss and dssim loss are merged together to achieve both training speed and pixel trueness
  • CA weights are automatically loaded after the first successful iterations, therefore you can test batch size for OOM before initializing the weights
  • Adding mid-face, which covers 30% more area than half face.
  • Changed learn mask default to n
  • Updated DF and LIAE loss values

Neural Network Optimization Algorithms:
With the new option 'network', you can switch between 'adam' and 'rmsprop'
  • Root Mean Square Prop (RMSProp) works by keeping an exponentially weighted average of the squares of past gradients
  • Adaptive Moment Estimation (Adam) combines ideas from both RMSProp and Momentum, therefore RMSProp uses less VRAM than Adam
SAE default network optimizer is Adam, while SAEHD is RMSProp
Since RMSProp uses less VRAM than Adam, you can run a higher batch size/resolution/dims

Which is better? Adam might be better since it uses a combination of 2 different algorithm but RMSProp is already good by itself, also uses less vram so you can run a higher batch/dim/res.  Really comes to testing and preference.

GTX 1070 8GB w/ 256res, batch 4, 256/21/21 dims LIAE adam example:
[Image: i51LD9K.jpg]

How to install on computer:

1. Download the model.py file
2. Go to your DeepFaceLab folder and navigate to _internal\DeepFaceLab\models\Model_SAE
3. Backup the existing model.py file
4. Copy the downloaded model.py into that folder
5. Profit???


How to install on colab:
1. Download the model.py file
2. Clone Github repository on colab
3. Go to Files tab on left side panel
4. Navigate to DeepFaceLab\models\Model_SAE
5. Right click on model.py and delete file
6. Right click on Model_SAE folder and click upload
7. Upload the model.py file that you downloaded from step 1
8. Profit???
(Note: You will have to do this again for every reset from colab)

Note: ONLY WORKS FOR DEEPFACELAB 1.0, WILL NOT WORK FOR 2.0
It should also be compatible with existing models running those versions as well. 
Just make sure to backup your model before you do this!


Download: You are not allowed to view links. Register or Login to view.

Credits to You are not allowed to view links. Register or Login to view.on his work on DeepFaceLab
Nice, I'll test it right away :D You wouldn't be able to add trueface or is it possible to do and still be able to run old models without retraining?
(10-29-2019, 10:18 PM)tutsmybarreh Wrote: You are not allowed to view links. Register or Login to view.Nice, I'll test it right away Big Grin You wouldn't be able to add trueface or is it possible to do and still be able to run old models without retraining?

If I recall, it shouldnt be too hard to add it in....I'll take a look into it tomorrow.
Alright went ahead and added TrueFace and another option called network which lets you toggle between 2 different learning algorithms, adam and rmsprop.

Also, TrueFace doesn't seem to artifact...maybe it's because it has less layers? dunno.

And should be compatible with existing models that runs Oct 15-27, 2019 builds.
Whats that adam/rmsprop? I haven't seen that mentioned on github, can you explain what it does and whats the difference.
BTW I'm finishing first fake with your modification, not sure if it looks any better since I have no comparison but it looks good.
(10-31-2019, 09:35 PM)tutsmybarreh Wrote: You are not allowed to view links. Register or Login to view.Whats that adam/rmsprop? I haven't seen that mentioned on github, can you explain what it does and whats the difference.
BTW I'm finishing first fake with your modification, not sure if it looks any better since I have no comparison but it looks good.

SAEHD uses RMSProp, while SAE uses Adam.  Both are different algorithms in learning.  Adam is a combination of RMSProp and another learning algorithm called Momentum, thus uses more vram than RMSProp (iperov mentioned something in his patch notes for SAEHD that the network now uses less vram, which i think is the switch to RMSProp).  Here is a more in-depth explanation: You are not allowed to view links. Register or Login to view.

Which is better? Adam might be better since it uses a combination of 2 different algorithm but RMSProp is already good by itself, also uses less vram so you can run a higher batch/dim/res.  Really comes to testing and preference.

Also, i updated the model.py again, fixed a small bug with network option resetting to 'adam'.
Here's another update, gave true face new options, 0 - Disabled, 1 - Low, 2 - Medium, 3 - High, 4 - Ultra ... higher = more aggressive training.

I used 4 and it seems to work quite well.

If you used the previous version, make sure to override the settings and change the input from "true/false" to 0 to 4.
I didn't noticed new update with the TrueFace strength setting. Aren't you iperov in disguise? :P
BTW since by default this is not in regular DFL (nor is an option to switch Adam/RMSProp) have you contacted iperov if he wouldn't want to add this by default to SAE and also bring TrueFace strength and likewise option to switch Adam/RMSProp to SAEHD? I know that he wants SAEHD to be the default/best model so adding this stuff to SAE might seem pointless but who knows. It's a cool option for people who don't want necessarily to retrain/make new SAEHD models and want to have some features of SAEHD in regular SAE.

Or is it actually pointless and you recommend users to just stick to SAEHD and treat this only as a "novelty" of sorts?

Also I sticked this thread so it always on top.
Well these changes are very simple code changes but experimental, so not something I want to do a pull request for. Also want to keep my GitHub account anonymous.

The TrueFace option is done automatically on SAEHD based on resolution (I think? Don't quote me on that), I'm just forcing it to whatever resolution you run. Pretty much the changes are all experimental, except maybe random warp and pixel loss merging.

Also adding Adam to SAEHD would probably not be idea since SAEHD is already vram heavy.

Personally I haven't seen much difference between SAE and SAEHD. Since SAE is lighter, I can run a higher resolution so I'm sticking with that for now. SAE is for older cards, SAEHD for newer cards.

Also thanks for the sticky.
(11-07-2019, 04:27 AM)tutsmybarreh Wrote: You are not allowed to view links. Register or Login to view.I didn't noticed new update with the TrueFace strength setting. Aren't you iperov in disguise? Tongue
BTW since by default this is not in regular DFL (nor is an option to switch Adam/RMSProp) have you contacted iperov if he wouldn't want to add this by default to SAE and also bring TrueFace strength and likewise option to switch Adam/RMSProp to SAEHD? I know that he wants SAEHD to be the default/best model so adding this stuff to SAE might seem pointless but who knows. It's a cool option for people who don't want necessarily to retrain/make new SAEHD models and want to have some features of SAEHD in regular SAE.

Or is it actually pointless and you recommend users to just stick to SAEHD and treat this only as a "novelty" of sorts?

Also I sticked this thread so it always on top.

Based on my personal experience TrueFace is not so good if your faceset has many different sources couse it tends to get more inconsistent lighting in the results, maybe works better if you have just one video for src or the same lighting.
What're your thought?
Pages: 1 2 3