Commit graph

92 commits

Author SHA1 Message Date
Colombo
f91a604c6d Manual extractor: now you can specify face rectangle manually using ‘R Mouse button’.
It is useful for small, blurry, undetectable faces, animal faces.
https://i.imgur.com/8kmVgg8.jpg
Warning: such frames must be used only with XSeg workflow !
Landmarks cannot be placed on the face precisely, and they are actually used for positioning the red frame.
Try to keep the red frame the same as the adjacent frames.
2020-06-02 12:31:24 +04:00
Colombo
8e9e346c9d Extractor: now face_type can be choosed in console dialog 2020-04-04 10:08:23 +04:00
Colombo
2b7364005d Added new face type : head
Now you can replace the head.
Example: https://www.youtube.com/watch?v=xr5FHd0AdlQ
Requirements:
	Post processing skill in Adobe After Effects or Davinci Resolve.
Usage:
1)	Find suitable dst footage with the monotonous background behind head
2)	Use “extract head” script
3)	Gather rich src headset from only one scene (same color and haircut)
4)	Mask whole head for src and dst using XSeg editor
5)	Train XSeg
6)	Apply trained XSeg mask for src and dst headsets
7)	Train SAEHD using ‘head’ face_type as regular deepfake model with DF archi. You can use pretrained model for head. Minimum recommended resolution for head is 224.
8)	Extract multiple tracks, using Merger:
a.	Raw-rgb
b.	XSeg-prd mask
c.	XSeg-dst mask
9)	Using AAE or DavinciResolve, do:
a.	Hide source head using XSeg-prd mask: content-aware-fill, clone-stamp, background retraction, or other technique
b.	Overlay new head using XSeg-dst mask

Warning: Head faceset can be used for whole_face or less types of training only with XSeg masking.

XSegEditor: added button ‘view trained XSeg mask’, so you can see which frames should be masked to improve mask quality.
2020-04-04 09:28:06 +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
54548afe1a refactoring 2020-03-06 01:21:38 +04:00
Colombo
810dc5ada5 Extractor: image size for all faces now 512 2020-02-27 16:20:37 +04:00
Colombo
b3b97b9802 fix RuntimeWarning during the extraction process 2020-02-25 09:59:48 +04:00
Colombo
f1d115b63b added experimental face type 'whole_face'
Basic usage instruction: https://i.imgur.com/w7LkId2.jpg

	'whole_face' requires skill in Adobe After Effects.

	For using whole_face you have to extract whole_face's by using
	4) data_src extract whole_face
	and
	5) data_dst extract whole_face
	Images will be extracted in 512 resolution, so they can be used for regular full_face's and half_face's.

	'whole_face' covers whole area of face include forehead in training square,
	but training mask is still 'full_face'
	therefore it requires manual final masking and composing in Adobe After Effects.

added option 'masked_training'
	This option is available only for 'whole_face' type.
	Default is ON.
	Masked training clips training area to full_face mask,
	thus network will train the faces properly.
	When the face is trained enough, disable this option to train all area of the frame.
	Merge with 'raw-rgb' mode, then use Adobe After Effects to manually mask, tune color, and compose whole face include forehead.
2020-02-21 16:21:04 +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
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
0ce96875a1 1 2020-01-22 18:49:32 +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
4e67278c66 fix 0 faces detected in manual extractor 2019-12-28 16:45:40 +04:00
Colombo
7174dc835a fixes 2019-12-22 21:44:28 +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
28b948888c fix extractor for some systems 2019-12-17 09:52:48 +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
f6f8f8ee5d change default jpg face extractor quality to 100 2019-11-11 09:13:42 +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
0d3b25812d fix 2019-10-20 18:02:23 +04:00
Colombo
85cbdcd290 revert fix "face could be detected twice" 2019-10-14 19:11:49 +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
Colombo
dc11ec32be SAE : WARNING, RETRAIN IS REQUIRED !
fixed model sizes from previous update.
avoided bug in ML framework(keras) that forces to train the model on random noise.

Converter: added blur on the same keys as sharpness

Added new model 'TrueFace'. This is a GAN model ported from https://github.com/NVlabs/FUNIT
Model produces near zero morphing and high detail face.
Model has higher failure rate than other models.
Keep src and dst faceset in same lighting conditions.
2019-09-19 11:13:56 +04:00
Colombo
faa14c4e59 fix extractor error on load grayscale images 2019-09-06 11:54:49 +04:00
iperov
b72d5a3f9a fixed error "Failed to get convolution algorithm" on some systems
fixed error "dll load failed" on some systems
Expanded eyebrows line of face masks. It does not affect mask of FAN-x converter mode.
2019-08-11 11:17:22 +04:00
iperov
8294feca24 extractior: fix extract from already extracted dflimg 2019-05-11 17:36:22 +04:00
iperov
e58197ca22 initial code to extract umdfaces.io dataset and train pose estimator 2019-04-23 08:14:09 +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
9f68b25987 Extractor: added warning messages if aligned folder contains files that will be deleted. 2019-04-06 10:01:59 +04:00
iperov
de8d75b4f7 fix mask editor,
upd manuals
2019-04-04 22:19:56 +04:00
iperov
b03b147bae refactoring 2019-03-26 11:09:44 +04:00
iperov
7a0cc56603 extractor: fixes, optimizations,
manual extractor: added 'a' option to switch accuracy mode
2019-03-21 18:56:32 +04:00
iperov
d1676dea06 refactorings, optimizations 2019-03-21 11:58:54 +04:00
iperov
a3df04999c removing trailing spaces 2019-03-19 23:53:27 +04:00
iperov
1f569117c8 accurate landmark extractor now by default 2019-03-19 14:01:15 +04:00
iperov
7c1ea1a617 removing dflimg image_to_face_mat 2019-03-18 14:42:10 +04:00
iperov
00c6a0cdaf accurate landmarks extraction now as an option 2019-03-18 11:24:41 +04:00
iperov
bf831331e6 fix 2019-03-18 10:58:03 +04:00