Commit graph

24 commits

Author SHA1 Message Date
Colombo
c58d2e8fb3 fix cv2.resize interpolation 2020-07-03 18:41:42 +04:00
Colombo
6d3607a13d New script:
5.XSeg) data_dst/src mask for XSeg trainer - fetch.bat
Copies faces containing XSeg polygons to aligned_xseg\ dir.
Useful only if you want to collect labeled faces and reuse them in other fakes.

Now you can use trained XSeg mask in the SAEHD training process.
It’s mean default ‘full_face’ mask obtained from landmarks will be replaced with the mask obtained from the trained XSeg model.
use
5.XSeg.optional) trained mask for data_dst/data_src - apply.bat
5.XSeg.optional) trained mask for data_dst/data_src - remove.bat

Normally you don’t need it. You can use it, if you want to use ‘face_style’ and ‘bg_style’ with obstructions.

XSeg trainer : now you can choose type of face
XSeg trainer : now you can restart training in “override settings”
Merger: XSeg-* modes now can be used with all types of faces.

Therefore old MaskEditor, FANSEG models, and FAN-x modes have been removed,
because the new XSeg solution is better, simpler and more convenient, which costs only 1 hour of manual masking for regular deepfake.
2020-03-30 14:00:40 +04:00
Colombo
efe3b56683 DFLIMG refactoring 2020-03-21 01:18:15 +04:00
Colombo
61472cdaf7 global refactoring and fixes,
removed support of extracted(aligned) PNG faces. Use old builds to convert from PNG to JPG.

fanseg model file in facelib/ is renamed
2020-03-13 08:09:00 +04:00
Colombo
54548afe1a refactoring 2020-03-06 01:21:38 +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
38b85108b3 DFL-2.0 initial branch commit 2020-01-21 18:43:39 +04:00
Colombo
754d6c385c refactorings 2019-12-22 19:00:59 +04:00
Colombo
8153e90ba3 refactoring 2019-12-22 14:05:41 +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
7ed38a8097 Converter:
Session is now saved to the model folder.

blur and erode ranges are increased to -400+400

hist-match-bw is now replaced with seamless2 mode.

Added 'ebs' color transfer mode (works only on Windows).

FANSEG model (used in FAN-x mask modes) is retrained with new model configuration
and now produces better precision and less jitter
2019-09-07 13:57:42 +04:00
iperov
046649e6be
update == 04.20.2019 == (#242)
* superb improved fanseg

* _

* _

* added FANseg extractor for src and dst faces to use it in training

* -

* _

* _

* update to 'partial' func

* _

* trained FANSeg_256_full_face.h5,
new experimental models: AVATAR, RecycleGAN

* _

* _

* _

* fix for TCC mode cards(tesla), was conflict with plaidML initialization.

* _

* update manuals

* _
2019-04-20 08:23:08 +04:00
iperov
5ac7e5d7f1 changed help message for pixel loss:
Pixel loss may help to enhance fine details and stabilize face color. Use it only if quality does not improve over time.

SAE:
previous SAE model will not work with this update.
Greatly decreased chance of model collapse.
Increased model accuracy.
Residual blocks now default and this option has been removed.
Improved 'learn mask'.
Added masked preview (switch by space key)

Converter:
fixed rct/lct in seamless mode
added mask mode (6) learned*FAN-prd*FAN-dst

added mask editor, its created for refining dataset for FANSeg model, and not for production, but you can spend your time and test it in regular fakes with face obstructions
2019-04-04 10:22:53 +04:00
iperov
a3df04999c removing trailing spaces 2019-03-19 23:53:27 +04:00
iperov
f3b343c0e5 small fixed and refactorings 2019-03-16 20:55:51 +04:00
iperov
9823421a44 added transparent mask to draw_landmarks 2019-03-14 12:16:21 +04:00
iperov
6094e5ead8 added Util.recover_original_aligned_filename 2019-03-04 10:57:44 +04:00
iperov
438213e97c manual extractor: increased FPS,
sort by final : now you can specify target number of images,
converter: fix seamless mask and exception,
huge refactoring
2019-02-28 11:56:31 +04:00
iperov
5e474c3462 added sort by one face in images. it trashes all images in which more than 1 face is found 2019-02-22 11:32:27 +04:00
iperov
6e12594af1 added util --add-landmarks-debug-images 2019-02-13 10:17:08 +04:00
iperov
06fe1314d8 removing default yaw_value from DFLIMG files,
added better pitch/yaw estimator from 68 landmarks,
improving face yaw accuracy for sorting and trainers,
added sort by face-pitch
2019-02-12 21:31:37 +04:00
iperov
5a1fb199f4 added support of non-english characters in paths 2019-02-05 19:33:55 +04:00
iperov
883da4b9ed fix Util.py, SAE: lowest ae dims now can be 32 (for testing) 2019-02-05 14:43:54 +04:00
iperov
6d95dd4a99 DFL now works with JPG files by default. Old PNG files also supported. Added util convertor PNG to JPG. 2019-02-04 19:47:24 +04:00