Commit graph

192 commits

Author SHA1 Message Date
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
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
f1a3150ce9 1 2020-01-22 22:14:31 +04:00
Colombo
0ce96875a1 1 2020-01-22 18:49:32 +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
38b85108b3 DFL-2.0 initial branch commit 2020-01-21 18:43:39 +04:00
Colombo
b5c234dac3 no_preview for model 2020-01-04 23:52:12 +04:00
Colombo
f95682f616 fix 2020-01-02 21:19:19 +04:00
Colombo
4e67278c66 fix 0 faces detected in manual extractor 2019-12-28 16:45:40 +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
7174dc835a fixes 2019-12-22 21:44:28 +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
9312a3c334 Extractor: 2nd pass now faster on frames where faces are not found 2019-12-22 10:46:44 +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
28b948888c fix extractor for some systems 2019-12-17 09:52:48 +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
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
006233656b facerelighther: added intensity param 2019-11-13 00:19:26 +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
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
f6f8f8ee5d change default jpg face extractor quality to 100 2019-11-11 09:13:42 +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
374d8c2388 fix denoise_image_sequence 2019-11-08 23:04:51 +04:00
Colombo
71a98e2ee4 compatibility fix 2019-11-04 02:01:28 +04:00
Colombo
410b8e98a0 fix manual extractor 2019-10-27 18:53:01 +04:00
Colombo
75eeef0a96 fix for amd 2019-10-24 21:59:13 +04:00
Colombo
734d97d729 added 'sort by vggface': sorting by face similarity using VGGFace model.
Requires 4GB+ VRAM and internet connection for the first run.
2019-10-23 15:06:39 +04:00
Colombo
0d3b25812d fix 2019-10-20 18:02:23 +04:00
Colombo
d3e35c8ce6 enhanced sort by final: now faces are evenly distributed not only in the direction of yaw, but also in pitch 2019-10-20 14:18:14 +04:00
Colombo
85cbdcd290 revert fix "face could be detected twice" 2019-10-14 19:11:49 +04:00
Colombo
5ad4b1011c refactoring after @kcimit 2019-10-14 17:20:43 +04:00
kcimit
d26ac4896e Restore mask functionality in mask editor (#442)
* Restore mask functionality

Once mask is saved (using 'c'), mask tool can apply same modifications to the next alignment (by pressing 'r'). Thus some routine work is decreased.

* Mask edit added function to re-apply changes
2019-10-14 17:14:57 +04:00
Colombo
1de1e0029f Extractor now produces a less shaked face. but second pass is now slower by 25%,
before/after: https://imgur.com/L77puLH
2019-10-14 12:09:32 +04:00
Colombo
e013cb0f6b moving some files 2019-10-14 09:34:44 +04:00
Colombo
2b264da86b fixed bug when same face can be detected twice 2019-10-13 14:59:50 +04:00
Colombo
63ecd4ec34 speed up S3FD extraction for GPU with >= 11GB vram 2019-10-10 13:22:14 +04:00
Colombo
d9d10f91c2 S3FD and 2DFAN-4 were improperly ported from pytorch. now fixed. 2019-09-20 17:16:37 +04:00