Commit Graph
100 Commits
Author SHA1 Message Date
Colombo 80d4eef1fe . 2020-04-11 23:38:35 +04:00
Colombo 23961879b4 Merger: color transfer ‘sot-m’ : reduced color flickering consuming x5 more time to process 2020-04-11 23:33:55 +04:00
Colombo 25324267d6 Merger: color transfer ‘sot-m’ : reduced color flickering 2020-04-11 21:33:47 +04:00
Colombo f72df02950 upd 2020-04-08 18:20:57 +04:00
Colombo 935d940ace fix 2020-04-07 22:06:32 +04:00
Colombo d8a792232c upd readme 2020-04-07 10:25:11 +04:00
Colombo 5b4d023712 added 5.XSeg) data_dst/data_src mask for XSeg trainer - remove.bat
removes labeled xseg polygons from the extracted frames
2020-04-06 21:45:46 +04:00
Colombo b6b3936bcd update readme 2020-04-06 20:15:46 +04:00
Colombo f821ab350f fix 2020-04-06 19:06:37 +04:00
Colombo afdb1ef85d fix for 16+ CPU 2020-04-06 18:42:38 +04:00
Colombo 453237bfd7 upd README.md 2020-04-06 17:55:33 +04:00
Colombo 215277b376 XSegEditor: fix 2020-04-05 14:14:56 +04:00
Colombo 33b0aadb4e Decreased amount of RAM used by Sample Generator. 2020-04-05 13:52:32 +04:00
Colombo 8e9e346c9d Extractor: now face_type can be choosed in console dialog 2020-04-04 10:08:23 +04:00
Colombo 8aa87c3080 upd README.md 2020-04-04 09:41:10 +04:00
Colombo 4db11aa133 upd README.md 2020-04-04 09:40:18 +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 383d4d3736 fix 2020-04-03 16:24:34 +04:00
Colombo 0fb912e91f Trainer: added --silent-start cmd option 2020-04-02 13:05:04 +04:00
Colombo 2fe86faf01 fix Win10 input dialog 2020-04-02 10:27:39 +04:00
Colombo dbb0988927 upd README.md 2020-04-01 22:17:59 +04:00
Colombo 652ef75099 upd README.md 2020-04-01 16:08:06 +04:00
Colombo 3702531898 SAEHD: ‘Face style power’ and ‘Background style power’ are now available for whole_face
New help messages for these options:

Face style power
Learn the color of the predicted face to be the same as dst inside mask.
If you want to use this option with 'whole_face' you have to use XSeg trained mask.
Warning: Enable it only after 10k iters, when predicted face is clear enough to start learn style.
Start from 0.001 value and check history changes.
Enabling this option increases the chance of model collapse

Background style power
      Learn the area outside mask of the predicted face to be the same as dst.
If you want to use this option with 'whole_face' you have to use XSeg trained mask.
This can make face more like dst.
Enabling this option increases the chance of model collapse. Typical value is 2.0
2020-03-30 19:46:17 +04:00
Colombo 9a9b7e4f81 fix 2020-03-30 14:39:07 +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 e5bad483ca upd readme 2020-03-30 09:53:46 +04:00
Colombo 3d4b9c858e deepfaker.xyz - 非官方网站帮助中国人学习DeepFaceLab 2020-03-29 21:48:47 +04:00
Colombo 497a7eec94 fix preview_history 2020-03-29 14:50:02 +04:00
Colombo 4e744cf184 Colab: change save preview iters to every 100 2020-03-28 13:58:41 +04:00
Colombo c3ce06a588 facetype.mouth 2020-03-28 09:38:09 +04:00
Colombo d1a5639e90 XSegEditor: fix bugs 2020-03-27 19:08:01 +04:00
Colombo 6687213fa5 SAEHD: fixed the use of pretrained liae model, now it produces less face morphing 2020-03-27 00:15:18 +04:00
Colombo ca9138d6b7 XSegEditor: changed layout, added current filename 2020-03-27 00:11:36 +04:00
Colombo 8ad2a5373e fix Exception("nn devices are not initialized. Run initialize_main_env() in main process.") 2020-03-24 22:06:10 +04:00
Colombo 2d5e949100 fix Chinesse language 2020-03-24 19:31:17 +04:00
Colombo 3a9f22f68e upd README.md 2020-03-24 16:21:32 +04:00
Colombo 01d81674fd added new XSegEditor !
here new whole_face + XSeg workflow:

with XSeg model you can train your own mask segmentator for dst(and/or src) faces
that will be used by the merger for whole_face.

Instead of using a pretrained segmentator model (which does not exist),
you control which part of faces should be masked.

new scripts:
	5.XSeg) data_dst edit masks.bat
	5.XSeg) data_src edit masks.bat
	5.XSeg) train.bat

Usage:
	unpack dst faceset if packed

	run 5.XSeg) data_dst edit masks.bat

	Read tooltips on the buttons (en/ru/zn languages are supported)

	mask the face using include or exclude polygon mode.

	repeat for 50/100 faces,
		!!! you don't need to mask every frame of dst
		only frames where the face is different significantly,
		for example:
			closed eyes
			changed head direction
			changed light
		the more various faces you mask, the more quality you will get

		Start masking from the upper left area and follow the clockwise direction.
		Keep the same logic of masking for all frames, for example:
			the same approximated jaw line of the side faces, where the jaw is not visible
			the same hair line
		Mask the obstructions using exclude polygon mode.

	run XSeg) train.bat
		train the model

		Check the faces of 'XSeg dst faces' preview.

		if some faces have wrong or glitchy mask, then repeat steps:
			run edit
			find these glitchy faces and mask them
			train further or restart training from scratch

Restart training of XSeg model is only possible by deleting all 'model\XSeg_*' files.

If you want to get the mask of the predicted face (XSeg-prd mode) in merger,
you should repeat the same steps for src faceset.

New mask modes available in merger for whole_face:

XSeg-prd	  - XSeg mask of predicted face	-> faces from src faceset should be labeled
XSeg-dst	  - XSeg mask of dst face        	-> faces from dst faceset should be labeled
XSeg-prd*XSeg-dst - the smallest area of both

if workspace\model folder contains trained XSeg model, then merger will use it,
otherwise you will get transparent mask by using XSeg-* modes.

Some screenshots:
XSegEditor: https://i.imgur.com/7Bk4RRV.jpg
trainer   : https://i.imgur.com/NM1Kn3s.jpg
merger    : https://i.imgur.com/glUzFQ8.jpg

example of the fake using 13 segmented dst faces
          : https://i.imgur.com/wmvyizU.gifv
2020-03-24 12:15:31 +04:00
Colombo eddebedcf6 SAEHD: added 'dfuhd' and 'liaeuhd' archi 2020-03-23 22:01:44 +04:00
Colombo e5f736680d _ 2020-03-23 18:57:17 +04:00
Colombo 14640db720 _ 2020-03-23 10:09:20 +04:00
Colombo 883f72867f Alipay 捐款 2020-03-22 20:56:57 +04:00
Colombo 7015f6fe09 QQ 捐款 2020-03-22 20:39:21 +04:00
Colombo ed8af226a3 QQ 捐款 2020-03-22 20:37:55 +04:00
Colombo 8bffc2b190 _ 2020-03-22 17:40:47 +04:00
Colombo bf68cef869 _ 2020-03-22 08:05:09 +04:00
Colombo 9a015c9bb5 _ 2020-03-21 17:38:52 +04:00
Colombo 3a1758d719 _ 2020-03-21 14:42:47 +04:00
Colombo c6e4ae8613 _ 2020-03-21 14:40:27 +04:00
Colombo 4a75e91daf _ 2020-03-21 14:36:50 +04:00
Colombo 51ec884d96 _ 2020-03-21 14:33:49 +04:00
Colombo acba34237c _ 2020-03-21 14:24:33 +04:00
Colombo f9684cb155 _ 2020-03-21 14:16:55 +04:00
Colombo 4b2bef8bd8 _ 2020-03-21 14:16:23 +04:00
Colombo deb705ad53 _ 2020-03-21 11:11:52 +04:00
Colombo 46eacd6fd2 upd readme 2020-03-21 11:03:15 +04:00
Colombo 9b11a9c9a4 add QQ 捐款 2020-03-21 10:42:08 +04:00
Colombo 7ab01ade43 upd 2020-03-21 09:20:02 +04:00
Colombo 57ceba3225 fix 2020-03-21 06:20:45 +04:00
Colombo efe3b56683 DFLIMG refactoring 2020-03-21 01:18:15 +04:00
Colombo a9b23e9851 _ 2020-03-21 00:01:53 +04:00
Colombo 79b8b8a7a7 upd SampleProcessor.py 2020-03-20 11:38:08 +04:00
Colombo 3fa93da5e7 upd 2020-03-20 11:37:42 +04:00
Colombo 4c24f9d41c _ 2020-03-19 13:29:33 +04:00
Colombo 9b070e10a6 fixed face jitter 2020-03-18 13:40:06 +04:00
Colombo 8a622428b1 _ 2020-03-16 23:15:13 +04:00
Colombo f3b4658810 fixes 2020-03-16 22:40:55 +04:00
Colombo 2300da40e9 upd readme 2020-03-15 22:46:17 +04:00
Colombo 94e38a43fd upd readme 2020-03-15 22:42:24 +04:00
Colombo 45582d129d added XSeg model.
with XSeg model you can train your own mask segmentator of dst(and src) faces
that will be used in merger for whole_face.

Instead of using a pretrained model (which does not exist),
you control which part of faces should be masked.

Workflow is not easy, but at the moment it is the best solution
for obtaining the best quality of whole_face's deepfakes using minimum effort
without rotoscoping in AfterEffects.

new scripts:
	XSeg) data_dst edit.bat
	XSeg) data_dst merge.bat
	XSeg) data_dst split.bat
	XSeg) data_src edit.bat
	XSeg) data_src merge.bat
	XSeg) data_src split.bat
	XSeg) train.bat

Usage:
	unpack dst faceset if packed

	run XSeg) data_dst split.bat
		this scripts extracts (previously saved) .json data from jpg faces to use in label tool.

	run XSeg) data_dst edit.bat
		new tool 'labelme' is used

		use polygon (CTRL-N) to mask the face
			name polygon "1" (one symbol) as include polygon
			name polygon "0" (one symbol) as exclude polygon

			'exclude polygons' will be applied after all 'include polygons'

		Hot keys:
		ctrl-N			create polygon
		ctrl-J			edit polygon
		A/D 			navigate between frames
		ctrl + mousewheel 	image zoom
		mousewheel		vertical scroll
		alt+mousewheel		horizontal scroll

		repeat for 10/50/100 faces,
			you don't need to mask every frame of dst,
			only frames where the face is different significantly,
			for example:
				closed eyes
				changed head direction
				changed light
			the more various faces you mask, the more quality you will get

			Start masking from the upper left area and follow the clockwise direction.
			Keep the same logic of masking for all frames, for example:
				the same approximated jaw line of the side faces, where the jaw is not visible
				the same hair line
			Mask the obstructions using polygon with name "0".

	run XSeg) data_dst merge.bat
		this script merges .json data of polygons into jpg faces,
		therefore faceset can be sorted or packed as usual.

	run XSeg) train.bat
		train the model

		Check the faces of 'XSeg dst faces' preview.

		if some faces have wrong or glitchy mask, then repeat steps:
			split
			run edit
			find these glitchy faces and mask them
			merge
			train further or restart training from scratch

Restart training of XSeg model is only possible by deleting all 'model\XSeg_*' files.

If you want to get the mask of the predicted face in merger,
you should repeat the same steps for src faceset.

New mask modes available in merger for whole_face:

XSeg-prd	  - XSeg mask of predicted face	 -> faces from src faceset should be labeled
XSeg-dst	  - XSeg mask of dst face        -> faces from dst faceset should be labeled
XSeg-prd*XSeg-dst - the smallest area of both

if workspace\model folder contains trained XSeg model, then merger will use it,
otherwise you will get transparent mask by using XSeg-* modes.

Some screenshots:
label tool: https://i.imgur.com/aY6QGw1.jpg
trainer   : https://i.imgur.com/NM1Kn3s.jpg
merger    : https://i.imgur.com/glUzFQ8.jpg

example of the fake using 13 segmented dst faces
          : https://i.imgur.com/wmvyizU.gifv
2020-03-15 15:12:44 +04:00
Colombo 2be940092b _ 2020-03-14 19:43:05 +04:00
Colombo eb63466baf fix 2020-03-14 17:17:53 +04:00
Colombo 7e0bdc0369 _ 2020-03-14 13:09:49 +04:00
Colombo c0d4ab3ac2 _ 2020-03-14 13:09:12 +04:00
Colombo 144675020c update SampleGeneratorFaceSkinSegDataset 2020-03-13 19:27:27 +04:00
Colombo 7c89077321 update core.imagelib 2020-03-13 19:27:13 +04:00
Colombo dde856499d saehd: removed liaech 2020-03-13 13:04:26 +04:00
Colombo a3a493bb93 _ 2020-03-13 10:44:50 +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 921b464d5b _ 2020-03-12 09:43:35 +04:00
Colombo ddfc005f8f _ 2020-03-12 03:04:12 +04:00
Colombo ba58621361 SAEHD: removed option learn_mask, it is now enabled by default 2020-03-10 10:36:08 +04:00
Colombo 5eaa59cea6 _ 2020-03-09 16:42:05 +04:00
Colombo b0b9072981 added XSeg model 2020-03-09 13:09:46 +04:00
Colombo a030ff6951 refactoring 2020-03-09 13:08:32 +04:00
Colombo 45abcff3d1 refactoring 2020-03-09 11:05:26 +04:00
Colombo 9eb15065f9 _ 2020-03-09 10:15:29 +04:00
Colombo f07349cc32 upd logo_python.png 2020-03-09 08:05:04 +04:00
Colombo d731930537 fixes 2020-03-09 00:18:01 +04:00
Colombo eda6433936 refactoring 2020-03-08 23:19:04 +04:00
Colombo 121c0cfc0f FANSeg : reverting to use it the same as in DFL 1.0 2020-03-08 22:25:11 +04:00
Colombo c371818eef upd README.md 2020-03-08 15:18:39 +04:00
Colombo 32f66ebc65 upd README.md 2020-03-08 15:17:32 +04:00
Colombo cc87c3ce1d upd README.md 2020-03-08 15:12:29 +04:00
Colombo cfea601877 upd README.md 2020-03-08 15:05:28 +04:00
Colombo d5c29b55e3 upd README.md 2020-03-08 14:48:19 +04:00
Colombo 22b0865455 upd FANSeg 2020-03-08 10:47:04 +04:00
Colombo 18d93376fc update FANSeg 2020-03-08 10:34:48 +04:00
Colombo 6f4ea69d4d added dev_segmented_extract,
extracts marked images in 'labelme' tool, that can be used in FANseg training
2020-03-08 10:13:15 +04:00
Colombo 143792fd31 added fanseg for future WF segmentation model 2020-03-08 00:49:12 +04:00
Colombo 3b6ad4abf9 refactoring 2020-03-07 20:51:54 +04:00