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.
This commit is contained in:
Colombo 2020-03-30 14:00:40 +04:00
parent e5bad483ca
commit 6d3607a13d
30 changed files with 279 additions and 1520 deletions

View file

@ -1053,7 +1053,7 @@ class LoaderQSubprocessor(QSubprocessor):
idx, filename = data
dflimg = DFLIMG.load(filename)
if dflimg is not None and dflimg.has_data():
ie_polys = SegIEPolys.load( dflimg.get_seg_ie_polys() )
ie_polys = dflimg.get_seg_ie_polys()
return idx, True, ie_polys.has_polys()
return idx, False, False
@ -1143,7 +1143,7 @@ class MainWindow(QXMainWindow):
return False
dflimg = DFLIMG.load(image_path)
ie_polys = SegIEPolys.load( dflimg.get_seg_ie_polys() )
ie_polys = dflimg.get_seg_ie_polys()
q_img = self.load_QImage(image_path)
self.canvas.op.initialize ( q_img, ie_polys=ie_polys )
@ -1155,12 +1155,12 @@ class MainWindow(QXMainWindow):
def canvas_finalize(self, image_path):
dflimg = DFLIMG.load(image_path)
ie_polys = SegIEPolys.load( dflimg.get_seg_ie_polys() )
ie_polys = dflimg.get_seg_ie_polys()
new_ie_polys = self.canvas.op.get_ie_polys()
if not new_ie_polys.identical(ie_polys):
self.image_paths_has_ie_polys[image_path] = new_ie_polys.has_polys()
dflimg.set_seg_ie_polys( new_ie_polys.dump() )
dflimg.set_seg_ie_polys( new_ie_polys )
dflimg.save()
self.canvas.op.finalize()