Commit graph

89 commits

Author SHA1 Message Date
Colombo
f4b163d721 fix 2020-02-18 19:34:23 +04:00
Colombo
d4335b5fa5 fix 2020-02-18 19:16:44 +04:00
Colombo
9598ba0141 SAEHD:
added option Eyes priority (y/n)

	fix eye problems during training  ( especially on HD architectures )
	by forcing the neural network to train eyes with higher priority
	before/after https://i.imgur.com/YQHOuSR.jpg

	It does not guarantee the right eye direction.
2020-02-18 14:30:07 +04:00
Colombo
5620763ccf "Enable autobackup" option is replaced by
"Autobackup every N hour" 0..24 (default 0 disabled), Autobackup model files with preview every N hour
2020-02-02 20:53:18 +04:00
Colombo
05f32d678d SAEHD: default archi is now 'df' 2020-01-31 22:42:25 +04:00
Colombo
9fd49ee3f0 removed use_float16 option
fix multigpu training
2020-01-30 07:35:33 +04:00
Colombo
5fe5fa131c SampleProcessor.py : refactoring and gen mask struct 2020-01-29 18:08:54 +04:00
Colombo
0251eb3490 MultiGPU training:
speed is significantly increased.
fixed CUDNN_STREAM errors.

Trainer: added key 'b' : creates a backup even if the autobackup is disabled.
2020-01-29 10:55:51 +04:00
Colombo
a6d72b620d fix asking options 2020-01-29 02:40:57 +04:00
Colombo
1fd4a25882 use_float16 update description 2020-01-28 15:22:03 +04:00
Colombo
01800010d4 options order fix 2020-01-28 15:17:11 +04:00
Colombo
9c6ca24642 fix update preview samples after disable pretrain 2020-01-28 13:32:01 +04:00
Colombo
7386a9d6fd optimized face sample generator, CPU load is significantly reduced
SAEHD:

added new option
GAN power 0.0 .. 10.0
	Train the network in Generative Adversarial manner.
	Forces the neural network to learn small details of the face.
	You can enable/disable this option at any time,
	but better to enable it when the network is trained enough.
	Typical value is 1.0
	GAN power with pretrain mode will not work.

Example of enabling GAN on 81k iters +5k iters
https://i.imgur.com/OdXHLhU.jpg
https://i.imgur.com/CYAJmJx.jpg

dfhd: default Decoder dimensions are now 48
the preview for 256 res is now correctly displayed

fixed model naming/renaming/removing

Improvements for those involved in post-processing in AfterEffects:

Codec is reverted back to x264 in order to properly use in AfterEffects and video players.

Merger now always outputs the mask to workspace\data_dst\merged_mask

removed raw modes except raw-rgb
raw-rgb mode now outputs selected face mask_mode (before square mask)

'export alpha mask' button is replaced by 'show alpha mask'.
You can view the alpha mask without recompute the frames.

8) 'merged *.bat' now also output 'result_mask.' video file.
8) 'merged lossless' now uses x264 lossless codec (before PNG codec)
result_mask video file is always lossless.

Thus you can use result_mask video file as mask layer in the AfterEffects.
2020-01-28 12:24:45 +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
60804ca3ba 1 2020-01-22 13:41:05 +04:00
Colombo
9797a70fd3 1 2020-01-21 21:05:29 +04:00
Colombo
38b85108b3 DFL-2.0 initial branch commit 2020-01-21 18:43:39 +04:00
Colombo
b8182ae42b remove lr_dropout for plaidml backend 2020-01-08 11:11:33 +04:00
Colombo
28549dc153 SAEHD:optimized architecture, you have to restart training 2019-12-28 16:50:33 +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
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
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
c0f258c336 SAE,SAEHD,Converter:
added sot-m color transfer

Converter:
removed seamless2 mode
2019-11-12 09:07:50 +04:00
Colombo
770c70d778 converter:
fixed crashes

removed useless 'ebs' color transfer

changed keys for color degrade

added image degrade via denoise - same as denoise extracted data_dst.bat ,
but you can control this option directly in the interactive converter

added image degrade via bicubic downscale and upscale

SAEHD: default ae_dims for df now 256.
2019-11-09 15:12:35 +04:00
Colombo
e3f63a7b40 fix 2019-10-15 17:37:16 +04:00
Colombo
73511a072a SAE/SAEHD:
removed option 'apply random ct'

added option
   Color transfer mode apply to src faceset. ( none/rct/lct/mkl/idt, ?:help skip: none )
   Change color distribution of src samples close to dst samples. Try all modes to find the best.
before was lct mode, but sometime it does not work properly for some facesets.
2019-10-15 11:22:19 +04:00
Colombo
aa523b3f2e change name 2019-10-12 16:13:23 +04:00
Colombo
91d2391ac9 fix 2019-10-12 14:09:48 +04:00
Colombo
8595c757ad change options order 2019-10-12 10:39:48 +04:00
Colombo
92f14dee70 SAEHD: added option Enable random warp of samples, default is on
Random warp is required to generalize facial expressions of both faces. When the face is trained enough, you can disable it to get extra sharpness for less amount of iterations.
2019-10-12 10:31:50 +04:00
Colombo
e15f846d08 SAE, SAEHD: random flip and learn mask options now can be overridden 2019-10-10 22:56:57 +04:00
Colombo
1f27d13f61 clip border for midface 2019-10-10 14:48:51 +04:00
Colombo
3f23135982 SAEHD: speed up for nvidia, duplicate code clean up 2019-10-08 21:02:20 +04:00
Colombo
627df082d7 fix for plaidml 2019-10-08 16:55:21 +04:00
Colombo
ac7725163d removed SAEv2,
added SAEHD model ( High Definition Styled AutoEncoder )
This is a new heavyweight model for high-end cards to achieve maximum possible deepfake quality in 2020.
Differences from SAE:
+ new encoder produces more stable face and less scale jitter
  before: https://i.imgur.com/4jUcol8.gifv
  after:  https://i.imgur.com/lyiax49.gifv - scale of the face is less changed within frame size
+ new decoder produces subpixel clear result
+ pixel loss and dssim loss are merged together to achieve both training speed and pixel trueness
+ by default networks will be initialized with CA weights, but only after first successful iteration
  therefore you can test network size and batch size before weights initialization process
+ new neural network optimizer consumes less VRAM than before
+ added option <Enable 'true face' training>
  The result face will be more like src and will get extra sharpness.
  example: https://i.imgur.com/ME3A7dI.gifv
  Enable it for last 15-30k iterations before conversion.
+ encoder and decoder dims are merged to one parameter encoder/decoder dims
+ added mid-full face, which covers 30% more area than half face.
2019-10-08 15:09:28 +04:00
Renamed from models/Model_SAEv2/Model.py (Browse further)