mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-07 05:22:06 -07:00
SAE: upd default params, upd readme
This commit is contained in:
parent
946688567d
commit
dd10d963d1
4 changed files with 18 additions and 12 deletions
22
README.md
22
README.md
|
@ -84,8 +84,6 @@ LIAEF128 Cage video:
|
|||
|
||||
- **SAE ( minimum 2GB+, recommended 11GB+ )** - Styled AutoEncoder - new superior model based on style loss. Morphing/stylizing done directly by neural network. Face obstructions also reconstructed without any masks. Converter mode 'overlay' should be used. Model has several options on start for fine tuning to fit your GPU.
|
||||
|
||||
SAE actually contains all other models. Just set style powers to 0.0 to get default models.
|
||||
|
||||

|
||||
|
||||

|
||||
|
@ -96,12 +94,22 @@ SAE model Cage-Trump video: https://www.youtube.com/watch?v=2R_aqHBClUQ
|
|||
|
||||
SAE model Putin-Navalny video: https://www.youtube.com/watch?v=Jj7b3mqx-Mw
|
||||
|
||||
Scene with extremely obstructed face in helmet, that cannot be handled by any other classic faceswap model (how to train it read tips):
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### **Tips and tricks**:
|
||||
|
||||
unfortunately deepfaking is time/eletricpower consuming topic and has a lot of nuances.
|
||||
|
||||
Quality of src faceset significantly affects the final face.
|
||||
|
||||
Narrow src face is better fakeable than wide. This is why Cage is so popular in deepfakes.
|
||||
|
||||
Every model is good for specific scenes and faces.
|
||||
|
||||
H64 - good for straight faces as a demo and for low vram.
|
||||
|
@ -112,11 +120,7 @@ DF - good for side faces, but results in a lower resolution and details. Covers
|
|||
|
||||
LIAE - can partially fix dissimilar face shapes, but results in a less recognizable face.
|
||||
|
||||
SAE - no matter how similar faces, src face will be morphed onto dst face, which can make face absolutely unrecognizable. Model can collapse on some scenes. Easy to overlay final face because dst background is also predicted.
|
||||
|
||||
Quality of src faceset significantly affects the final face.
|
||||
|
||||
Narrow src face is better fakeable than wide. This is why Cage is so popular in deepfakes.
|
||||
SAE - actually contains all other models, but better due to multiscale decoder. Just set style powers to 0.0 to get default models.
|
||||
|
||||
SAE tips:
|
||||
|
||||
|
@ -130,7 +134,9 @@ SAE tips:
|
|||
|
||||
- if you have a lot of VRAM, you can choose between batch size that affects quality of generalization and enc/dec dims that affects image quality.
|
||||
|
||||
- if style speed is too fast, you will get the artifacts before the face becomes sharp.
|
||||
- how to train extremely obstructed face model with SAE:
|
||||
|
||||
First train it with both style powers at 10.0+ value. When artifacts become appearing at ~30-40k epochs, set face style to 0.0 or 0.01 and bg style to 0.1-0.3 and continue training. You can slightly vary theese values during training if something goes wrong. Track changes in preview history.
|
||||
|
||||
### **Sort tool**:
|
||||
|
||||
|
|
BIN
doc/SAE_Cage_2.jpg
Normal file
BIN
doc/SAE_Cage_2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 122 KiB |
BIN
doc/SAE_Cage_3.jpg
Normal file
BIN
doc/SAE_Cage_3.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 124 KiB |
|
@ -35,17 +35,17 @@ class SAEModel(ModelBase):
|
|||
self.options['archi'] = self.options.get('archi', default_archi)
|
||||
self.options['lighter_encoder'] = self.options.get('lighter_encoder', False)
|
||||
|
||||
default_face_style_power = 2.0
|
||||
default_face_style_power = 10.0
|
||||
if is_first_run or ask_override:
|
||||
default_face_style_power = default_face_style_power if is_first_run else self.options.get('face_style_power', default_face_style_power)
|
||||
self.options['face_style_power'] = np.clip ( input_number("Face style power ( 0.0 .. 100.0 ?:help skip:%.1f) : " % (default_face_style_power), default_face_style_power, help_message="How fast NN will learn dst face style during generalization of src and dst faces."), 0.0, 100.0 )
|
||||
self.options['face_style_power'] = np.clip ( input_number("Face style power ( 0.0 .. 100.0 ?:help skip:%.1f) : " % (default_face_style_power), default_face_style_power, help_message="How fast NN will learn dst face style during generalization of src and dst faces. If style is learned good enough, set this value to 0.01 to prevent artifacts appearing."), 0.0, 100.0 )
|
||||
else:
|
||||
self.options['face_style_power'] = self.options.get('face_style_power', default_face_style_power)
|
||||
|
||||
default_bg_style_power = 2.0
|
||||
default_bg_style_power = 10.0
|
||||
if is_first_run or ask_override:
|
||||
default_bg_style_power = default_bg_style_power if is_first_run else self.options.get('bg_style_power', default_bg_style_power)
|
||||
self.options['bg_style_power'] = np.clip ( input_number("Background style power ( 0.0 .. 100.0 ?:help skip:%.1f) : " % (default_bg_style_power), default_bg_style_power, help_message="How fast NN will learn dst background style during generalization of src and dst faces."), 0.0, 100.0 )
|
||||
self.options['bg_style_power'] = np.clip ( input_number("Background style power ( 0.0 .. 100.0 ?:help skip:%.1f) : " % (default_bg_style_power), default_bg_style_power, help_message="How fast NN will learn dst background style during generalization of src and dst faces. If style is learned good enough, set this value to 0.1-0.3 to prevent artifacts appearing."), 0.0, 100.0 )
|
||||
else:
|
||||
self.options['bg_style_power'] = self.options.get('bg_style_power', default_bg_style_power)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue