mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-11 15:47:01 -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) )
|
||||
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():
|
||||
alignments[ source_filename_stem ] = []
|
||||
|
||||
|
|
|
@ -235,7 +235,9 @@ def relight(input_dir, lighten=None, random_one=None):
|
|||
i += 1
|
||||
|
||||
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:
|
||||
io.log_err (f"Exception occured while processing file {filepath.name}. Error: {traceback.format_exc()}")
|
||||
|
||||
|
|
|
@ -246,6 +246,9 @@ class DFLJPG(object):
|
|||
|
||||
def remove_fanseg_mask(self):
|
||||
self.dfl_dict['fanseg_mask'] = None
|
||||
|
||||
def remove_source_filename(self):
|
||||
self.dfl_dict['source_filename'] = None
|
||||
|
||||
def dump(self):
|
||||
data = b""
|
||||
|
|
|
@ -364,6 +364,9 @@ class DFLPNG(object):
|
|||
|
||||
def remove_fanseg_mask(self):
|
||||
self.dfl_dict['fanseg_mask'] = None
|
||||
|
||||
def remove_source_filename(self):
|
||||
self.dfl_dict['source_filename'] = None
|
||||
|
||||
def dump(self):
|
||||
data = PNG_HEADER
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue