mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-12 08:07:03 -07:00
fix of converter when using relighted faces in dst
This commit is contained in:
parent
4868bd1324
commit
2167c5cbcb
4 changed files with 16 additions and 2 deletions
|
@ -687,7 +687,13 @@ def main (args, device_args):
|
||||||
io.log_err ("%s is not a dfl image file" % (filepath.name) )
|
io.log_err ("%s is not a dfl image file" % (filepath.name) )
|
||||||
continue
|
continue
|
||||||
|
|
||||||
source_filename_stem = Path( dflimg.get_source_filename() ).stem
|
source_filename = dflimg.get_source_filename()
|
||||||
|
if source_filename is None or source_filename == "_":
|
||||||
|
continue
|
||||||
|
|
||||||
|
source_filename = Path(source_filename)
|
||||||
|
source_filename_stem = source_filename.stem
|
||||||
|
|
||||||
if source_filename_stem not in alignments.keys():
|
if source_filename_stem not in alignments.keys():
|
||||||
alignments[ source_filename_stem ] = []
|
alignments[ source_filename_stem ] = []
|
||||||
|
|
||||||
|
|
|
@ -235,7 +235,9 @@ def relight(input_dir, lighten=None, random_one=None):
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
cv2_imwrite (relighted_filepath, relighted_img )
|
cv2_imwrite (relighted_filepath, relighted_img )
|
||||||
dflimg.embed_and_set (relighted_filepath, source_filename="_", relighted=True )
|
|
||||||
|
dflimg.remove_source_filename()
|
||||||
|
dflimg.embed_and_set (relighted_filepath, relighted=True )
|
||||||
except:
|
except:
|
||||||
io.log_err (f"Exception occured while processing file {filepath.name}. Error: {traceback.format_exc()}")
|
io.log_err (f"Exception occured while processing file {filepath.name}. Error: {traceback.format_exc()}")
|
||||||
|
|
||||||
|
|
|
@ -247,6 +247,9 @@ class DFLJPG(object):
|
||||||
def remove_fanseg_mask(self):
|
def remove_fanseg_mask(self):
|
||||||
self.dfl_dict['fanseg_mask'] = None
|
self.dfl_dict['fanseg_mask'] = None
|
||||||
|
|
||||||
|
def remove_source_filename(self):
|
||||||
|
self.dfl_dict['source_filename'] = None
|
||||||
|
|
||||||
def dump(self):
|
def dump(self):
|
||||||
data = b""
|
data = b""
|
||||||
|
|
||||||
|
|
|
@ -365,6 +365,9 @@ class DFLPNG(object):
|
||||||
def remove_fanseg_mask(self):
|
def remove_fanseg_mask(self):
|
||||||
self.dfl_dict['fanseg_mask'] = None
|
self.dfl_dict['fanseg_mask'] = None
|
||||||
|
|
||||||
|
def remove_source_filename(self):
|
||||||
|
self.dfl_dict['source_filename'] = None
|
||||||
|
|
||||||
def dump(self):
|
def dump(self):
|
||||||
data = PNG_HEADER
|
data = PNG_HEADER
|
||||||
for chunk in self.chunks:
|
for chunk in self.chunks:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue