Commit Graph
100 Commits
Author SHA1 Message Date
Colombo 80f285067a upd readme 2020-01-27 20:30:07 +04:00
Colombo 17337ea8f8 fixed model renaming/deleting 2020-01-26 14:49:37 +04:00
Colombo c485e1718a fixes 2020-01-26 12:56:21 +04:00
Colombo 76ca79216e Upgraded to TF version 1.13.2
Removed the wait at first launch for most graphics cards.

Increased speed of training by 10-20%, but you have to retrain all models from scratch.

SAEHD:

added option 'use float16'
	Experimental option. Reduces the model size by half.
	Increases the speed of training.
	Decreases the accuracy of the model.
	The model may collapse or not train.
	Model may not learn the mask in large resolutions.

true_face_training option is replaced by
"True face power". 0.0000 .. 1.0
Experimental option. Discriminates the result face to be more like the src face. Higher value - stronger discrimination.
Comparison - https://i.imgur.com/czScS9q.png
2020-01-25 21:58:19 +04:00
Colombo a3dfcb91b9 1 2020-01-25 18:18:06 +04:00
Colombo f7f4e44a98 1 2020-01-24 11:51:54 +04:00
Colombo be5df1e269 fix 2020-01-23 22:46:45 +04:00
Colombo 1f0c91f053 add SampleGeneratorFaceTemporal.py 2020-01-23 19:09:23 +04:00
Colombo afcfa9c69e fix io.input_skip_pending for colab 2020-01-23 10:20:29 +04:00
Colombo 591bba2c1e fix clipgrad option 2020-01-23 09:30:43 +04:00
Colombo 967fbdd814 BREAKING CHANGES !!!
Getting rid of the weakest link - AMD cards support.
All neural network codebase transferred to pure low-level TensorFlow backend, therefore
removed AMD/Intel cards support, now DFL works only on NVIDIA cards or CPU.

old DFL marked as 1.0 still available for download, but it will no longer be supported.

global code refactoring, fixes and optimizations

Extractor:

now you can choose on which GPUs (or CPU) to process

improved stability for < 4GB GPUs

increased speed of multi gpu initializing

now works in one pass (except manual mode)
so you won't lose the processed data if something goes wrong before the old 3rd pass

Faceset enhancer:

now you can choose on which GPUs (or CPU) to process

Trainer:

now you can choose on which GPUs (or CPU) to train the model.
Multi-gpu training is now supported.
Select identical cards, otherwise fast GPU will wait slow GPU every iteration.

now remembers the previous option input as default with the current workspace/model/ folder.

the number of sample generators now matches the available number of processors

saved models now have names instead of GPU indexes.
Therefore you can switch GPUs for every saved model.
Trainer offers to choose latest saved model by default.
You can rename or delete any model using the dialog.

models now save the optimizer weights in the model folder to continue training properly

removed all models except SAEHD, Quick96

trained model files from DFL 1.0 cannot be reused

AVATAR model is also removed.
How to create AVATAR like in this video? https://www.youtube.com/watch?v=4GdWD0yxvqw
1) capture yourself with your own speech repeating same head direction as celeb in target video
2) train regular deepfake model with celeb faces from target video as src, and your face as dst
3) merge celeb face onto your face with raw-rgb mode
4) compose masked mouth with target video in AfterEffects

SAEHD:

now has 3 options: Encoder dimensions, Decoder dimensions, Decoder mask dimensions

now has 4 arhis: dfhd (default), liaehd, df, liae
df and liae are from SAE model, but use features from SAEHD model (such as combined loss and disable random warp)

dfhd/liaehd - changed encoder/decoder architectures

decoder model is combined with mask decoder model
mask training is combined with face training,
result is reduced time per iteration and decreased vram usage by optimizer

"Initialize CA weights" now works faster and integrated to "Initialize models" progress bar

removed optimizer_mode option

added option 'Place models and optimizer on GPU?'
  When you train on one GPU, by default model and optimizer weights are placed on GPU to accelerate the process.
  You can place they on CPU to free up extra VRAM, thus you can set larger model parameters.
  This option is unavailable in MultiGPU mode.

pretraining now does not use rgb channel shuffling
pretraining now can be continued
when pre-training is disabled:
1) iters and loss history are reset to 1
2) in df/dfhd archis, only the inter part of the encoder is reset (before encoder+inter)
   thus the fake will train faster with a pretrained df model

Merger ( renamed from Converter ):

now you can choose on which GPUs (or CPU) to process

new hot key combinations to navigate and override frame's configs

super resolution upscaler "RankSRGAN" is replaced by "FaceEnhancer"

FAN-x mask mode now works on GPU while merging (before on CPU),
therefore all models (Main face model + FAN-x + FaceEnhancer)
now work on GPU while merging, and work properly even on 2GB GPU.

Quick96:

now automatically uses pretrained model

Sorter:

removed all sort by *.bat files except one sort.bat
now you have to choose sort method in the dialog

Other:

all console dialogs are now more convenient

new default example video files data_src/data_dst for newbies ( Robert Downey Jr. on Elon Musk )

XnViewMP is updated to 0.94.1 version

ffmpeg is updated to 4.2.1 version

ffmpeg: video codec is changed to x265

_internal/vscode.bat starts VSCode IDE where you can view and edit DeepFaceLab source code.

removed russian/english manual. Read community manuals and tutorials here
https://mrdeepfakes.com/forums/forum-guides-and-tutorials

new github page design
2020-01-22 22:23:55 +04:00
Colombo f1a3150ce9 1 2020-01-22 22:14:31 +04:00
Colombo 869c5e8dd0 1 2020-01-22 18:58:02 +04:00
Colombo af3306a85a 1 2020-01-22 18:56:00 +04:00
Colombo 0ce96875a1 1 2020-01-22 18:49:32 +04:00
Colombo 2d61b715de 1 2020-01-22 18:27:19 +04:00
Colombo afafd89982 1 2020-01-22 17:23:08 +04:00
Colombo 3924ef2bf5 1 2020-01-22 17:21:33 +04:00
Colombo 60804ca3ba 1 2020-01-22 13:41:05 +04:00
Colombo 0c93b89e87 1 2020-01-22 10:46:35 +04:00
Colombo beed145d29 1 2020-01-22 10:29:17 +04:00
Colombo 9797a70fd3 1 2020-01-21 21:05:29 +04:00
Colombo 56de1d9fa5 1 2020-01-21 18:50:52 +04:00
Colombo 38b85108b3 DFL-2.0 initial branch commit 2020-01-21 18:43:39 +04:00
Colombo 52a67a61b3 Sample loader : back to serial one core loader 2020-01-11 23:20:39 +04:00
Colombo bbe81b20af - 2020-01-08 15:12:43 +04:00
Colombo b8182ae42b remove lr_dropout for plaidml backend 2020-01-08 11:11:33 +04:00
Colombo d3e6b435aa fixes and optimizations 2020-01-07 13:45:54 +04:00
Colombo 842a48964f fix 2020-01-05 14:21:34 +04:00
Colombo ea33541177 fix 2020-01-05 13:58:25 +04:00
Colombo 21b25038ac optimized sample generator 2020-01-05 11:53:31 +04:00
Colombo b5c234dac3 no_preview for model 2020-01-04 23:52:12 +04:00
Colombo 2429d28737 optimize memory usage 2020-01-04 23:51:33 +04:00
Colombo f95682f616 fix 2020-01-02 21:19:19 +04:00
Colombo 5efb430f2a +WScaleConv2DLayer 2020-01-01 11:15:55 +04:00
Colombo efd8c16daa avatar: avatar_type is now only head by default 2019-12-29 19:37:59 +04:00
Colombo 47e539ccdd fix extract unaligned faces 2019-12-29 19:36:34 +04:00
Colombo 818a2d65f0 fix long load when using various gpus in the same DFL folder 2019-12-29 18:47:55 +04:00
Colombo 540650c610 fix faceset enhancer for frames that contain edited mask 2019-12-29 18:10:05 +04:00
Colombo 28549dc153 SAEHD:optimized architecture, you have to restart training 2019-12-28 16:50:33 +04:00
Colombo 4e67278c66 fix 0 faces detected in manual extractor 2019-12-28 16:45:40 +04:00
Colombo 3849172a43 add GeLU 2019-12-27 21:25:59 +04:00
Colombo 0833a38bb9 Quick96: optimized architecture 2019-12-27 21:06:45 +04:00
Colombo a347bb4f15 change doc about builds 2019-12-27 14:29:27 +04:00
Colombo 7804e0bd7c add try except 2019-12-27 13:36:01 +04:00
Colombo df8cf35c75 FacesetEnhancer now asks to merge aligned_enhanced/ to aligned/ 2019-12-27 11:09:15 +04:00
Colombo d46fb5cfd3 fixed mask editor
added FacesetEnhancer
4.2.other) data_src util faceset enhance best GPU.bat
4.2.other) data_src util faceset enhance multi GPU.bat

FacesetEnhancer greatly increases details in your source face set,
same as Gigapixel enhancer, but in fully automatic mode.
In OpenCL build it works on CPU only.

Please consider a donation.
2019-12-26 21:27:10 +04:00
Colombo 3be223a265 fix MaskEditor 2019-12-25 11:13:52 +04:00
Colombo ac1913c070 fix 2019-12-24 14:07:06 +04:00
Colombo 3feb386a8e fix for colab 2019-12-24 11:20:32 +04:00
Colombo c482b2cd07 upd reaedme 2019-12-23 19:16:33 +04:00
Colombo b93ae56a08 upd readme 2019-12-23 19:15:59 +04:00
Colombo 8c17dd85f4 upd readme 2019-12-23 19:06:30 +04:00
Colombo 94c99b429d fix 2019-12-23 15:17:13 +04:00
Colombo c1612c5553 fixes 2019-12-23 14:57:47 +04:00
Colombo 7174dc835a fixes 2019-12-22 21:44:28 +04:00
Colombo 7e609542db fixes 2019-12-22 21:17:34 +04:00
Colombo 9ed0111824 fix 2019-12-22 19:10:57 +04:00
Colombo 754d6c385c refactorings 2019-12-22 19:00:59 +04:00
Colombo e0e8970ab9 fix PackedFaceset 2019-12-22 15:58:46 +04:00
Colombo dd45b7dacc cleaning 2019-12-22 15:02:53 +04:00
Colombo 8153e90ba3 refactoring 2019-12-22 14:05:41 +04:00
Colombo 246129a964 change samples.pak to faceset.pak 2019-12-22 13:32:19 +04:00
Colombo 9312a3c334 Extractor: 2nd pass now faster on frames where faces are not found 2019-12-22 10:46:44 +04:00
Colombo 8305832a27 fix 2019-12-21 23:27:51 +04:00
Colombo 50f892d57d all models: removed options 'src_scale_mod', and 'sort samples by yaw as target'
If you want, you can manually remove unnecessary angles from src faceset after sort by yaw.

Optimized sample generators (CPU workers). Now they consume less amount of RAM and work faster.

added
4.2.other) data_src/dst util faceset pack.bat
	Packs /aligned/ samples into one /aligned/samples.pak file.
	After that, all faces will be deleted.

4.2.other) data_src/dst util faceset unpack.bat
	unpacks faces from /aligned/samples.pak to /aligned/ dir.
	After that, samples.pak will be deleted.

Packed faceset load and work faster.
2019-12-21 23:16:55 +04:00
Colombo 8866dce22e added
4.2.other) data_src util faceset metadata save.bat
	saves metadata of data_src\aligned\ faces into data_src\aligned\meta.dat

4.2.other) data_src util faceset metadata restore.bat
	restore metadata from 'meta.dat' to images
	if image size different from original, then it will be automatically resized

You can greatly enhance face details of src faceset by using Topaz Gigapixel software.
example https://i.imgur.com/Gwee99L.jpg
Example of workflow:
1) run 'data_src util faceset metadata save.bat'
2) launch Topaz Gigapixel
3) open 'data_src\aligned\' and select all images
4) set output folder to 'data_src\aligned_topaz' (create folder in save dialog)
5) set settings as on screenshot https://i.imgur.com/kAVWMQG.jpg
	you can choose 2x, 4x, or 6x upscale rate
6) start process images and wait full process
7) rename folders:
	data_src\aligned        ->  data_src\aligned_original
	data_src\aligned_topaz  ->  data_src\aligned
8) copy 'data_src\aligned_original\meta.dat' to 'data_src\aligned\'
9) run 'data_src util faceset metadata restore.bat'
	images will be downscaled back to original size (256x256) preserving details
	metadata will be restored
10) now your new enhanced faceset is ready to use !
2019-12-20 15:03:17 +04:00
Colombo 5e6a1f5249 fix 2019-12-20 14:16:44 +04:00
Colombo 021bb6d128 SAEHD: lr_dropout now as an option, and disabled by default 2019-12-20 12:04:44 +04:00
Colombo 951942821d 1 2019-12-20 11:04:26 +04:00
Colombo cf27558e88 SAEHD: lr_dropout now as an option, and disabled by default 2019-12-20 10:39:05 +04:00
Colombo 64021b9c62 more stable and precise version of face transformation matrix.
fixed bleeding mask on some samples
2019-12-20 10:30:49 +04:00
Colombo 068c7d0d55 temporary revert last fixes 2019-12-20 10:21:59 +04:00
Colombo dd1d5e8909 improved face align,
More stable and precise version of the face transformation matrix.
Now full_faces are aligned with the upper and lateral boundaries of the frame,
result: fix of cutted mouth, increase area of the cheeks of side faces
before/after https://i.imgur.com/t9IyGZv.jpg
therefore, additional training is required for existing models.
Optionally, you can re-extract dst faces of your project, if they have problems with cutted mouth or cheeks.
2019-12-19 18:33:04 +04:00
Colombo 9e9dc364c9 temporary revert fix 2019-12-19 15:46:50 +04:00
Colombo 853a056769 more stable and precise version of face transformation matrix 2019-12-19 15:25:06 +04:00
Colombo c04740eac1 1 2019-12-17 09:53:17 +04:00
Colombo 28b948888c fix extractor for some systems 2019-12-17 09:52:48 +04:00
Colombo 71ebf06c89 SAEHD,Quick96:
improved model generalization, overall accuracy and sharpness
by using new 'Learning rate dropout' technique from paper https://arxiv.org/abs/1912.00144
An example of a loss histogram where this function is enabled after the red arrow:
https://i.imgur.com/3olskOd.jpg
2019-12-15 15:53:06 +04:00
Colombo c866448645 clean 2019-12-11 22:34:22 +04:00
Colombo d4745b5cf8 added sort by absdiff
This is sort method by absolute per pixel difference between all faces.
options:
Sort by similar? ( y/n ?:help skip:y ) :
if you choose 'n', then most dissimilar faces will be placed first.
2019-12-11 22:33:49 +04:00
Colombo e8673e3fcc nothing interesting 2019-12-11 22:33:23 +04:00
Colombo 154820a954 ConvertMasked: fix color bug for superresolution 2019-12-06 16:49:27 +04:00
Colombo f7920d3880 1 2019-11-24 20:33:34 +04:00
Colombo 77b390c04b 1 2019-11-24 19:51:07 +04:00
Colombo 1bfd65abe5 extractor for AMD gpu: increase no response time 2019-11-24 19:37:21 +04:00
Colombo 6b14741160 1 2019-11-21 11:40:55 +04:00
Colombo 668513a507 1 2019-11-16 16:54:10 +04:00
Colombo b74c2b1f9a Converter: added new color transfer mode: mix-m 2019-11-14 12:08:27 +04:00
Colombo 1cc24f2a75 1 2019-11-13 10:31:04 +04:00
Colombo 0a1a9b4fed fix 2019-11-13 00:29:41 +04:00
Colombo 006233656b facerelighther: added intensity param 2019-11-13 00:19:26 +04:00
Colombo 54786848bc fix converterconfig 2019-11-13 00:19:01 +04:00
Colombo 8c3fa3baa5 fix 2019-11-12 18:02:23 +04:00
Colombo 2167c5cbcb fix of converter when using relighted faces in dst 2019-11-12 17:37:13 +04:00
Colombo 4868bd1324 upd doc/doc_prebuilt_windows_app.md 2019-11-12 09:16:42 +04:00
Colombo c0f258c336 SAE,SAEHD,Converter:
added sot-m color transfer

Converter:
removed seamless2 mode
2019-11-12 09:07:50 +04:00
Colombo 05153d9ba5 FacesetRelighter fixes and improvements:
now you have 3 ways:
1) define light directions manually (not for google colab)
   watch demo https://youtu.be/79xz7yEO5Jw
2) relight faceset with one random direction
3) relight faceset with predefined 8 directions
2019-11-11 19:56:36 +04:00
Colombo fe58459f36 added FacesetRelighter:
Synthesize new faces from existing ones by relighting them using DeepPortraitRelighter network.
With the relighted faces neural network will better reproduce face shadows.

Therefore you can synthsize shadowed faces from fully lit faceset.
https://i.imgur.com/wxcmQoi.jpg

as a result, better fakes on dark faces:
https://i.imgur.com/5xXIbz5.jpg

in OpenCL build Relighter runs on CPU,

install pytorch directly via pip install, look at requirements
2019-11-11 11:42:52 +04:00
Colombo b9c0815d17 added random shuffle to samples in SampleGeneratorFace.py 2019-11-11 11:35:46 +04:00